# Grand summary question

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

## Recommended Posts

Hi all,

I'm summarizing line items of sales records. Items are charged in more than one currency, so I'm sorting/breaking the report by currency. I don't use a body part, only summaries, so that, for example, 85 sales of product xyz are shown on a single line per currency. The next line might show 34 sales of the same item in another currency. This works fine so far.

In the trailing grand summary, I'd like to show the total like so:

Total sales, US\$: 2346.50

Total sales, EUR: 3562.52

This doesn't work the way my parts are set up, since I can only have the number field calculated once and FM just adds up all the numbers regardless of the currency. Can this still be done somehow?

Stefan

##### Share on other sites

I don't understand your question. What do the totals represent?

If I am guessing (!) correctly, your report is broken first by product, then by currency? If so, I would suggest you produce the grand totals as text in a global field, using the FastSummaries method.

Alternatively, if you have a fixed list of currencies, you could use a repeating calculation field to split the amounts by currency, and a summary field to total the repetitions individually.

Edited by comment
• 1
##### Share on other sites

The totals should represent the total sales, but broken down by currency. This is what I had envisioned in the report:

[Summary (by currency and product)]

product    qty    currency   price     total

ABC        3        USD         5            15 <- these are already summarized by product ID from several line items

YDH       1       USD          10           10

ABC       2        EUR          8            16

[Trailing grand summary]

Total USD: 25

Total EUR: 16

Instead, the trailing grand summary currently shows:

Total: 41

I will find out about FastSummaries, don't know what that is. The calculation field method would probably work, too. How about a calculation field that would summarize all line items with the same currency based on a relationship. I think that would require one field per currency. Not as straight forward as a summary field. I don't expect more than 3 currencies.

Thanks,

Stefan

Edited by stefangs
##### Share on other sites

2 hours ago, stefangs said:

How about a calculation field that would summarize all line items with the same currency based on a relationship.

I don't think that's a good idea. Your report should work with whatever happens to be the found set. Relationships ignore found sets. If you wanted to omit certain products from your report, the totals fetched via a relationship would be incorrect.

Here's a demo showing the repeating calculation field method. Note that this will always show the totals for all currencies in the value list.

Edited by comment
• 2
##### Share on other sites

Thanks so much for the template you sent me. It will take me a bit to absorb it, but I'm sure it will do. My idea above didn't sound that appealing to me, either!

Stefan

##### Share on other sites

Comment, your template works perfectly. I must admit, however, that I just sort of copied the code. Can you tell me why you are referencing the file name in the cLabelsR field? It looks like the purpose of this field is to figure out how many currencies are used.

Thanks much,

Stefan

##### Share on other sites

2 hours ago, stefangs said:

It looks like the purpose of this field is to figure out how many currencies are used.

The purpose of the field is to take the "Currencies" value list and put each value into its own repetition.

2 hours ago, stefangs said:

Can you tell me why you are referencing the file name

Because that's one of the parameters of the ValueListItems() function.

##### Share on other sites

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

## Create an account

Register a new account

• ### Similar Content

• #### picture is cropped in print

By ericire,

• 0 replies
• 897 views
• #### Weird date format

By stefangs,

• 2 replies
• 1,712 views
• #### Filemaker 6 for Mac issue.

By Tumma K,

• (and 4 more)

Tagged with:

• 8 replies
• 4,295 views
• #### FM3 upgrade to FM Pro 5.5 - Windows 8 installation possible?

By MrEddByrnes,

• (and 4 more)

Tagged with:

• 5,092 views
• #### Moving data from fp5 to fp13

By bmill,

• (and 4 more)

Tagged with:

• 2 replies
• 3,365 views
×
×
• Create New...