Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Field Summing Post Reply Post New Topic
Author Message
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Topic: Formula Field Summing
    Posted: 19 Nov 2007 at 10:29am
Good afternoon,
 
I have a question for the group.
 
The following formula field multiplies a $ figure times a %. 
 
IF {@CONV - SlsPrsn ID} = 5481 then {@MC $} * 1 else

IF {@CONV - SlsPrsn ID} = 2940 then {@MC $} * 1 else

IF {@CONV - SlsPrsn ID} = 5484 then {@MC $} * .30 else
IF {@CONV - SlsPrsn ID} = 5480 then {@MC $} * .15 else

IF {@CONV - SlsPrsn ID} = 5483 then {@MC $} * .30 else
IF {@CONV - SlsPrsn ID} = 5479 then {@MC $} * .15 else

IF {@CONV - SlsPrsn ID} = 5485 then {@MC $} * .30 else
IF {@CONV - SlsPrsn ID} = 5478 then {@MC $} * .15

CR does not sum the fields and I can't insert summaries.
 
Any ideas on how to get around this?
 
THanks,
 
srklg1
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Nov 2007 at 10:51am
Have you tried a manual running total?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Posted: 19 Nov 2007 at 11:28am

Not sure how to do that.  Is there documentation on that function somewhere?

srklg1
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 20 Nov 2007 at 6:45am
Here is a simple overview of the concept.  You'll be looking at method #2.

Tek-tips has a number of decent FAQs.  Like this one, they tend to be a little sparse.  But, they'll often get you going in the right direction.


IP IP Logged
H0P5
Newbie
Newbie


Joined: 20 Jun 2007
Online Status: Offline
Posts: 14
Quote H0P5 Replybullet Posted: 21 Nov 2007 at 4:39am
Hello Mate
 
Did you get any luck with your drama?
 
I am having exactly the same problem. My formula calculates what I am looking for, allows me to use it as a group summary, but won't allow me to select it as a report summary.
 
 
H0P5
IP IP Logged
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Posted: 21 Nov 2007 at 10:31am
Dude,
 
No luck yet, and I tried the Crosstab solution that was suggested but the sums came out TOO LARGE.  I'm trying to figure out the manual running total . . .
 
Will let you know what I come up with!
 
Thanks for checkin' in!
 
SRK
srklg1
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 21 Nov 2007 at 11:00am
Crosstabs are no good for this question. The link that Lugh mentioned is a good summary of running totals. What specific problems did you run into when you tried that?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Posted: 21 Nov 2007 at 11:37am

The formula field I would like to have a running total on does not come up in the list on the Create Running Total Field.  Is there another place to add the field?  It's on the report.

Thanks! 
srklg1
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 21 Nov 2007 at 1:55pm
Yes, CR can't do running totals on certain formulas depending upon what it is calculating and what types of functions it uses. That's why you have to use a manual running total. If you look at the link that Lugh posted, you can use that code to create a global variable which sums the value of your formula for every field. Then in the report footer you can print the value of this global variable to get the formula's running total.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.