Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summing up a formula Post Reply Post New Topic
Author Message
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Topic: Summing up a formula
     Posted: 03 Aug 2011 at 6:15am
I have a report that sums up the amunt of pieces in the field in the detail section. I have a formula in the format editor that if it exceeds 100 I want it to just show 100 and it all works fine. The problem I have is in the group footer I want to sum this field. If I run a sum on the column it gives me the number of all of it, so if one of the numbers is 1400 I have it set to display 100 and that is what I need it to add.
 
 
Actual    what is displayed
25                  25
25                  25
1400            100
50                  50
 
what I currently get is 1500
what I need my reslut to be is 200
 
 
Thanks
KevV
 
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 03 Aug 2011 at 8:41am

do you use a parameter to set the number of records or a conditional supression.

they best way to get accurate summaries is to use manual running totals. if you search here i have posted the formulas on other questions.
sharona
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 03 Aug 2011 at 9:32am
I am not using either to get the number. It comes from adding smaller pieces in the databse and then in the format editor under the display string I have the formula:
 
if currentfieldvalue>100 then '100' else totext(currentfieldvalue,0,'')
which using my earlier example makes the column with 1400 display just 100. but when I sum the field it sums it as 1400 plus whatever else is in the column.
 
KevV
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 03 Aug 2011 at 10:20am
I believe it is because it is taking what the actual formula/field is instead of what it is displaying. Try creating a formula that actually changes the value instead of just using the field and changing how it displays.
|< /\ '][' ( )
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 03 Aug 2011 at 11:33am
you need to sum your formula so it only picks up the 100 or zero values etc.
sharona
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 03 Aug 2011 at 11:42am
I tried creating a formula first and I couldn't get one that would work. The formula I have in the first formula is:
 
instr({@Ugly},"Ugly") > 0
 
I have the field I am summing and then evaluting using the above formula and then reseting on change of group. I tried adding a formula in with this one to cap it at 100 but I couldn't make one work.
 
Thanks
KevV
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