Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How to get calculation field to calculate ALL portal rows, not just first portal row


This topic is 1484 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hey guys,

 

I am working on a brewing recipe file and I have created a IBU calculator. I have the calculation working but it needs to be based on all of the portal rows. Currently it only reads from the first portal row and will not make any further adjustments to the calculation for additional rows. I don't know if I am missing something in my calculation or what.

This is the formula for the IBU field, and it is basing the findings from a portal called "Hop Database Copy"

Brewing Recipes = ( Hop Database Copy::Quantity * ( Hop Database Copy::Alpha Acids * 100 ) * Hop Database Copy::Percent ) / 7.25

Thank you for your help,

 

Alex

Brewing Copy.fmp12

Posted
20 minutes ago, Agian510 said:

it needs to be based on all of the portal rows

What exactly does 'based on" mean? Should it sum up all the individual portal row results? Or maybe average them? Or ... ?

Posted

Thank you for your response.

Each portal row is it's own calculation but then I would like it to sum up each portal rows results. This should get the desired outcome that I am seeking.

Posted (edited)

The simple method is to split the calculation into two fields: one defined in the child table that calculates a result for each portal record.  The other, defined in the parent table, does simply Sum ( ChildTable::Calcfield ). Or you could define a summary field in the child table to do essentially same thing - total the calculation field.

It is also possible to do this in a single calculation field in the parent table that loops over the child records and accumulates the individual results. However, you would need the Advanced version in order to construct a custom recursive function. Or version 18 or higher in order to use the While() function.

--
P.S. All those parentheses are redundant.

 

Edited by comment

This topic is 1484 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.