Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getsummary problems

Featured Replies

I'm using FM 8, Win Vista. I'm having a lot of difficulty using Getsummary functions. I need to use them because I need to calculate values based on Summnary fields. For example, can they be used in trailing grand summary parts? Sometimes they appear to calculate properly, other times not. I've attached a complete description of the program I'm preparing as well as screen shots in layout and browse modes.

The only issue is with the TaxCredit calculation. It does not work correctly in either the subsummary or training grand summary parts. It does use the related field TaxRate and I wonder is this causes a problem with Getsummary calculations.

Program_to_calculate_the_tax_on_Gasoline.pdf

I just use normal Summary fields in leading and trailing summary parts. Have you tried them?

  • Author

I found the answer. I was using the wrong occurrence table for the TaxCredit related field! Makes me feel dumb :o

Now, my final question is how can I get the total of TaxCredit for display in the Trailing Grand Summary. The problem is that TaxCredit is computed with GetSummary fields and I therefore can't use a summary field or GetSummary field to calculate the total. Or can I?

John

No you would always be in a record after sorting, this means the global will recieve the avarage from state that comes first in the sort order! The scripted GetSummary( will pick the subsummary you're in!

As I understand your field definitions, would I instead use

GetNthRecord( in two recursive calc's to make the avarage you need in the global field:

http://www.briandunning.com/cf/439

Now the delimiter is a ¶ but should be a + instead, so change the CF accordingly, the two strings is then put inside each thier own Evaluate( -statement.

If you're absolutely sure you need to summarize all records, not just a found set. Could instead use List( over a cartesian relation, and then Substitute( the pilcrows with plusses, to make the Evaluate( work!

--sd

  • Author

Thanks, I would like to give it a try. But using GetNthRecord is beyond me.I hope you can give me a better explanation. I do want to summarize the records in the found set.

John

Alright I've made you a tiny template, with the simplest CF I can think of, however will you need to get a tail-recursion'ish if you need to summarize beyond 10000 records.

--sd

SummarizeViaEvaluate.zip

I may be missing something here, but it seems to me a "native" solution (i.e. using summary fields and summary calculations) should be possible here. I am puzzled why the average needs to be scripted, instead of using a summary field defined as Average.

Perhaps a demo file showing the original problem would be useful.

The avarage is needed in a global field, but yes why???

--sd

  • Author

Thanks for the file. One question. What is the GrapNumbers function in the Evaluate function?

John

Ah! Thats the CF, but I then see that you can't develop CF's with you version of Filemaker. But the CF is going this way:

Case(



Found > 1;



GetNthRecord(Field; Found) & "+" & GrapNumbers(Field; Found - 1);



GetNthRecord(Field; 1)



)

Which you obviously then can't use - sorry, instead should you perhaps use some of this:

http://www.kevinfrank.com/download/kf-fast-summary.zip

--sd

OK, then I guess I'll just shut up then.

  • Author

I've just upgraded to FM 8.5 Advanced. Does that make a difference?

OK, then I guess I'll just shut up then

Oh no! It's been nagging me as well, neither can I see the purpose for the avarage there, only I would know how to do it if it really is manditory.

My guess however is probably like yours that the utilization of the some of the other options (I've drawn a red box around in the image above) in the summary field def' have been ignored???

Usually is it only Fenton and you, who can get away with the use of globals, when I begin to scrutinize suggestions :o

--sd

Billede_1.jpg

Edited by Guest

Yes it does, then would I like to turn your attention to:

File>Define>Custom Functions...

...when inspecting my template!

--sd

The only thing I have suggested is to better define the problem, so it can be solved using paper and pencil first. I am quite sure I cannot do this by following the description attached to the original post, because when I do, I always end up with NetTaxableFuel = 0. So obviously something is missing.

I am guessing each trip has, in addition to Miles, a TaxableMiles attribute (and I suspect that "NetTaxableFuel" should actually read "NonTaxableFuel"). I believe that once you put this in place, it can be all done with a couple of summary fields and some calc fields using GetSummary().

I am amazed by the amount of techniques you have a suggested as an alternative - to what?

I am amazed by the amount of techniques you have a suggested as an alternative - to what?

LOL!

The only thing I have suggested is to better define the problem

Since we usually are spoiled rotten with such extravaganza!

--sd

  • 3 weeks later...

Sorry to jump in but rather than a new topic....

Is it possbile to sort based on on vaiables (count or amount) prior to setting the "output" field?

New to creating any custom reports other than 'builtin' featureset of FM....sorry if it is obvious question.

Thanks for your time!

using example linked up:

http://www.kevinfrank.com/download/kf-fast-summ ary...

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.