SUM data based on TEXT field

Hello,

I have a JOBS table with a COST field.

I need users to be able to assign labels to jobs so they can be grouped together. Then I need to sum up the cost of jobs with identical labels and display them back to the user.

My current thinking is that users will use a dropdown to display a total cost for whatever label they select. Getting the drop-down to show unique values hasn’t worked unless I use “this field has multiple entries” which really it doesn’t have multiple entries, just one label per job.

I suppose I could go about this a different way and try to display a repeating group that is contrained by the label and then displays a total of each item’s cost.

Anyway. I’m just kinda stuck on this so if anyone has any insights, examples, or ideas, I’d appreciate the help!

Is the cost field of type number or text?

Likely an option set would work, but depends on what these labels are

If labels are option sets and costs are field of type number it is simple, just filter the jobs by the label option value and use operator sum: each items cost

They would use a dropdown to select a label if it is an option set. The cost would be done via an input element set to type integer to save as a field of type number.

Cost field is a number.

Option set won’t work because the label needs to be dynamic based on user input. I suppose, if push comes to shove, I could create a data type where they create ne field labels. That approach just seems like overkill. I’m basically just trying to make a quick way for people to group different items together to check out the total cost.

Need some type of data for the grouping, usually an option set works best. If the label can not be an option set due to dynamic needs, a category selector can be an option set just so it is possible to group different labels together in some way.