
1. Re: Calculating Summary Fields
comment Nov 6, 2012 3:51 PM (in response to AjEGfmTech)Isn't this the same question as before?

2. Re: Calculating Summary Fields
AjEGfmTech Nov 6, 2012 4:34 PM (in response to comment)Nope. It is the same database solution that I'm working on, but the other post was about problems I was having with getting the rounding error corrected, this one is about why the GetSummary function does not seem to work to add to summary fields together. While these posts have to deal with resulting amounts being off by pennies, they are two different parts of the sought after solution.
Thanks for asking though.

3. Re: Calculating Summary Fields
comment Nov 6, 2012 4:57 PM (in response to AjEGfmTech)ajegfmtech wrote:
this one is about why the GetSummary function does not seem to work to add to summary fields together.
The GetSummary() function is not supposed to add summary fields together. But that's not important, because AFAICS you are using it correctly.
I am still not sure what your "new" question is. The penny discrepancy is clearly the result of rounding error and nothing else. You say that Royalty = NetSales * RateRoyalty, but your data shows that it's actually rounded to two decimal places, as is AdFund. Remove the rounding and it will all match at 1098.9448.
Message was edited by: Michael Horak

4. Re: Calculating Summary Fields
keywords Nov 6, 2012 4:55 PM (in response to AjEGfmTech)If you add up your AdFund totals you get 274.75. Back to your rounding issue! Try rounding Royalty, AdFubd and Transfer and see what you get.

5. Re: Calculating Summary Fields
AjEGfmTech Nov 6, 2012 6:13 PM (in response to comment)Thanks for the reply Michael and for taking the time to look at my post thoroughly. You are correct, the data I posted does show only two decimals. That's because I have the data formatting set to two decimals. The actual data is the 1,098.9448. I had removed all rounding during my posts about the 'Round function'. My new question is actually not about the rounding, even though that discrepancy is what I'm trying to work around.
All of the data I submitted is actually out to four decimal places, its just the formatting that only shows the two decimals I posted here.
I was not trying to have the 'GetSummary()' function add summary fields. I was trying to add the RESULT of a GetSummary() function, but it didn't work. My 'new' question is simply, shouldn't adding the result of two GetSummary() functions equal the sum of those two Summary totals?
...
Thanks Michael. Your questions got me to look at the elements and results again. I found my problem. I was presuming that my adding the GetSummary() results was not working properly because the 'TotalTransferCalc' result was identical to the 'TotalTransfer' result. I had displayed both GetSummary() results separately to make sure that they were producing the desired result. By initial inspecition, they were working correctly because they showed 824.21 and 274.74. However, you question reminded me that I was seeing the result with the display data formatting set to 2 decimals. Underneath, the real resulting values of the GetSummary() functions were 824.2086 and 274.7362. When I added those together, it was no wonder that the result was still 1098.9448, which rounds to 1098.94.
The solution then was not to remove the rounding, but rather introduce it, but at the right point.
I changed the GetSummary() field calculations to below and it is now producing the correct result.
Round ( GetSummary ( TotalRoyalty ; StoreID ) ; 2 )
Round ( GetSummary ( TotalAdFund ; StoreID ) ; 2 )
So, after all of this, the GetSummary() is working to allow calculating summary fields. Thanks for your help Michael.

6. Re: Calculating Summary Fields
AjEGfmTech Nov 6, 2012 6:17 PM (in response to keywords)Thanks for looking into this and replying 'keywords'. I was replying while your post must have come in. I found the answer, I needed to round the GetSummary() results. Thanks for your suggestion too though.