Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Summary Totals not matching expected results Post Reply Post New Topic
Author Message
moontide
Groupie
Groupie
Avatar

Joined: 23 Feb 2011
Online Status: Offline
Posts: 78
Quote moontide Replybullet Topic: Summary Totals not matching expected results
     Posted: 16 Mar 2011 at 2:45am
I have another issue with a report I have been working on and the initial issue is taking care of, but now I have problems getting summary totals to meet the expected results when put in the group header. Below are the details on this report. The Total is a calculated value which is "item_price *item quantity". item price is coming from one table and item quantity is coming from another table which are equally joined with a bunch of other tables joined. The first two record totals are showing correct results but the remaining records, totals are showing numbers that are way over the expected numbers. Its grouped by the strucCode. The totalAmt is a summarized value and need to be summarized to show the expected value.
 
Group header: Project   Buidling#   structure#    Date  TotalAmt  StrucCode
 
1.                     11223   45009789  45009789   01/12/11 11111.34        05
2.                     12788   78990099  78990099   01/12/11 34566.90        02
3.                     34544   37888899  37888899   01/12/11 25565566.78  06
 
record 3 should be 128999.90 --> record 4 and so forth is showing numbers four times the expected value. So I am trying to figure out what could be the problem. I tried playing around with table links but its giving the same results and then I was thinking if I have to use a variable for the
TotalAmt and then do a conditional formula to get the values or what. Anyone who might have come across the same issue please let me know and will appreciate it.
  
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 16 Mar 2011 at 3:12am
Are you suppressing any values? For instance any duplicates that you don't want to see.

Summaries do not ignore suppressed values and cause those kinds of problems if you're not careful.

Edited by Keikoku - 16 Mar 2011 at 3:13am
IP IP Logged
moontide
Groupie
Groupie
Avatar

Joined: 23 Feb 2011
Online Status: Offline
Posts: 78
Quote moontide Replybullet Posted: 16 Mar 2011 at 5:37am
Detail: Project   Buidling#   structure#    Date     TotalAmt  StrucCode
 
1. Det  11223   45009789  45009789   01/12/11 10011.30        05
2.        11223   45009789  45009789   01/12/11   1100.04        05
3. GH  1223   45009789  45009789   01/12/11 11111.34  05     
 
4.        12788   78990099  78990099   01/12/11 34000.60        02
5.        12788   78990099  78990099   01/12/11     566.30        02
6.       12788  78990099 78990099 01/12/11 34566.90   02
 
7.         34544   37888899  37888899   01/12/11         5566.08  06
8.         34544   37888899  37888899   01/12/11         5566.08  06
9.         34544   37888899  37888899   01/12/11 25560000.70  06
10.       34544   37888899  37888899   01/12/11 25560000.70  06
11.       34544   37888899  37888899   01/12/11 25560000.70  06
12.   34544   37888899  37888899  01/12/11 76691134.26   06
 
record # 1 and 2 are showing detail values that add up to the total in the GH(Group Header), same thing with records 4 and 5 add up to give the total in GH which is correct, but records 7 to 11 keep repeating several times to give a bigger than expected total where the total is supposed to be 25565566.78 in the GH. and this goes on to the remaining records for different StrucCodes and at times several of the detail record values repeat almost 30 times to add up 30 times the actual total. so how do i avoid repeating numbers from adding up for the summary values in the GH? Help Please !
 
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 16 Mar 2011 at 7:20am
Since you are grouping on Project, and your only condition appears to be "I only want unique numbers" then you can set your running total condition to evaluate only if

totalAmt <> previous(totalAmt)

If it is possible to have different building# and structure# with the same TotalAmt then you will have to use multiple conditions to specify how to handle each situation.
IP IP Logged
moontide
Groupie
Groupie
Avatar

Joined: 23 Feb 2011
Online Status: Offline
Posts: 78
Quote moontide Replybullet Posted: 16 Mar 2011 at 8:32am

I tried using the condition for the running totals but it is not working, the duplicates are still there and it also seems like the running totals do not show the total that is equal to the summarized total value in bold.

IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 16 Mar 2011 at 9:51am
The running total is supposed to ignore duplicate values and only add unique values.

What are the values you're getting with the same example using the running total?
IP IP Logged
moontide
Groupie
Groupie
Avatar

Joined: 23 Feb 2011
Online Status: Offline
Posts: 78
Quote moontide Replybullet Posted: 16 Mar 2011 at 10:06am
Well the running total is only adding up all the record values from the beginning, but Im actually looking for total amt grouped by the StrucCode, each StrucCode will have its own Summarized TotalAmt which is independent of other StrucCodes, I dont want all the records to add up regardless of what the StrucCode is. All I want is to add up the unique numbers to get the totalAmt for each StrucCode. I used the "on change of >groups" in the running total but it didnt give me what i wanted.
 
I actually got the running total to work this time. For 'Evaluate' I used the change of field option which is the TotAmt formula and for the 'reset' I used the Group by option and chose the field that is being calculated. The values are coming out right but they are appearing several times. For each Proj # there are several TotAmt values and the last value is the correct one. The running total is in the detail section and all I want is to display the last value or max value as the running total value, instead of having several occurences. Now, how do I fix that? Need some help guys


Edited by moontide - 21 Mar 2011 at 4:10am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum