stefangs Posted February 17, 2016 Posted February 17, 2016 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? Thanks in advance, Stefan
comment Posted February 17, 2016 Posted February 17, 2016 (edited) 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 February 17, 2016 by comment 1
stefangs Posted February 17, 2016 Author Posted February 17, 2016 (edited) 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 February 17, 2016 by stefangs
comment Posted February 17, 2016 Posted February 17, 2016 (edited) 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. SplitAmountsR.fp7 Edited February 17, 2016 by comment 2
stefangs Posted February 17, 2016 Author Posted February 17, 2016 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
stefangs Posted February 20, 2016 Author Posted February 20, 2016 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
comment Posted February 21, 2016 Posted February 21, 2016 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.
Recommended Posts
This topic is 3471 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 accountSign in
Already have an account? Sign in here.
Sign In Now