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

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

Recommended Posts

Posted

Hi everyone, it has been some time since I have touched my database. I am facing a new problem: I have a list of prices with a foundset total. I would like to get a new total of that foundset omitting  amounts equal and less than $500. Each amount of the list is the result of a calculation.  Do I need to create a new relationship for that or a portal for both foundsets.

Thank you for your time and guidance.

Patrick D.

Posted

If you total is provided by a summary field then it should simply be a case of constraining your found set. A summary field totals the current found set.

Posted

Hi Keywords, Thank you for answering. I understand your idea but... A script runs a selection between two dates and the result must report all the payments made. So far so good, I have a sum of the foundset. Now I need, on the same page, with the same dates, to sum all records with a value of ≥ $500. The reason is, these payments come from a separate bank account.

My guess is to use two portals with two calculations. One for the total sum and the other with the calculated result. How do I write this calculation?

Posted

Basically, you have two options:

1. Find all records between the two dates. Open a new window and constrain the found set to records whose value is ≥ 500. Set a global field (or variable) with the total of this subset. Close the window to return to the original found set. Show the overall total using a summary field, and the subtotal using the global field/variable.

2. Define a calculation field like:

If ( Value ≥ 500 ; Value )

and use a second summary field as the total of this field.

 

3 hours ago, PatrickDes said:

The reason is, these payments come from a separate bank account.

You would think there would be another way to distinguish between them. And I would also think you would want to show the total of each account separately - i.e. sort the records by the account (or, if there is no other way, by a calculation field that returns true when the value is ≥ 500) and show the sub-totals by placing the summary field in a sub-summary part.

 

 

  • Like 1
Posted

Ooh, very good idea. Thank you. I will try the second option, much simpler.

PS: This is how easily I used to resolve it in Excel: A column with a looping calculation to pull the ≥ 500. Very static but working.

1170358497_ScreenShot2020-02-08at10_14_52PM.thumb.png.9b869da1e3fd7826d5fedfbc884085ce.png

Posted
54 minutes ago, PatrickDes said:

This is how easily I used to resolve it in Excel

In Excel, it could be much simpler using the SUMIF() function. Unfortunately, Filemaker does not have an equivalent function, so you would need to perform the IF and the SUM separately - as suggested in my 2nd option. Or write a custom function to loop over the found records and return the sum of only those that meet the criteria.

However, since you are already running a script anyway, the smart thing would be to let the script do all the required work, instead of adding an extra calculation field and a summary field to the schema. Which is why my 1st option is listed first.

 

Posted

Thank you Comment, truly appreciated.

At the end, I chose the second solution. The reason is, the new calculated field and summary are needed in a list view as well. My client loves visual references and feel safer having all the columns in plain sight.

The file is very fast and adding the 2 new fields will not affect speed.

Patrick D.

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