Can someone help me with a formula please?

Hi, I’m trying to create a meal nutrition tracker.

My Setup:

  • Meal Ingredients Database: Lists each ingredient of a meal along with its nutritional values (like protein and fat).
  • Totals Database: A separate database where I want to calculate the total nutrition for each meal, including the total protein.

My Goal:

  • In the Totals Database, I want a column that sums up the protein for each meal based on the ingredients listed in the Meal Ingredients Database.

The Problem:

  • My current formula in the Totals Database is not calculating the sum of the protein; it’s showing 0.

Can anyone see what is wrong with my formula or suggest a better way? I’m new to coda btw.

hi @Daniel_Robertshaw , welcome to the community

you could try to replace thisRow.meal with only thisRow and the reason is that you reference the object since it is in a relation type column.

cheers, Christiaan

Hi, thanks for the quick response. I spent so long on this last night and right after posting this this morning had another crack and got it working!

My ‘Meal Ingredients Database’ first row is a relation to a ‘Meals’ database. My ‘Totals Databse’ first row was a relation to ‘Meal Ingredients Database’. I instead changed this so it was also a relation to to my ‘Meals’ database and the formula worked! :tada:

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