Jump to content
Server Maintenance This Week. ×

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


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

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

This topic is 1262 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.