Sum Based on Unique Values

Hi All, Newbie Here!

Im attempting to create an app where I have a table of Meal Names, Ingredients and Quantity of said ingredients per meal.

The aim is that the user selects a meal (or multiple) and the required ingredients are then shown.

I have managed this part however i now am struggling where rather than ingredients being repeated in a list id like a single occurrence of the ingredient with a sum of the total requirements of said ingredient.

Below is a table where you can see the ingredients, “New column” identifies where its parent meal has been selected but you will see multiple “onion” for example.

How can i generate a unique list yet sum the total requirements?

thanks

Chris

  • Add a rowID column to the Ingredients table.
  • Create a query on that same Ingredients table, filter by ingredient is the same as this row > ingredient and “new column A” (please name this column accordingly) is checked.
  • Add a rollup column to sum the quantity on top of the query.
  • Add a single value column to return the first rowID from the query.
  • Show a collection targetting this table, filter by rowID is the same as the single value column, and quantity > 0.
1 Like

Hi ThinDinh,

So after multiple false starts i finally did what you suggested properly and it works splendidly, my sincere thanks!

Whilst undoubtedly powerful getting my head around this not being a spreadsheet is taking some time :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.