Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping formula problem Post Reply Post New Topic
Author Message
djustice
Newbie
Newbie
Avatar

Joined: 08 Feb 2012
Location: United States
Online Status: Offline
Posts: 17
Quote djustice Replybullet Topic: Grouping formula problem
     Posted: 13 Mar 2012 at 4:59am
I have a report with groupings.  I have three formulas in one of the groupings.  2 of the formulas are sum's  sum of @TotalHours
and sum of @BlindHours.

These 2 work fine as far as grouping goes, they sum the group, not the total.

I have a third formula sum({@BlindHours})/sum({@TotalHours})
This formula return the same result for every grouping and the total?

Why do the other formulas work by grouping, but not the third?

thanks for any help.
DDavid Justice
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Mar 2012 at 5:10am
sum(field) sums all rows
sum(field,groupfield) will give you subtotal at each group instance. It must be placed inside the group sections (gh or gf) to show the value per group.
 
If you create a summary using the insert summary function and then drag and drop it from a Report footer to the group footer or header it will automatically add the group  condition to it. That is not the case with a formula field that you create manually.
 


Edited by DBlank - 13 Mar 2012 at 5:11am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Mar 2012 at 5:11am
there is not grouping information in the 3rd formula, so it is running for entire report...does that fit with the values that you are seeing?
 
I would try adding the group to the formula, like:
IP IP Logged
djustice
Newbie
Newbie
Avatar

Joined: 08 Feb 2012
Location: United States
Online Status: Offline
Posts: 17
Quote djustice Replybullet Posted: 13 Mar 2012 at 5:24am
Yep, that did it.  Thanks so much!
DDavid Justice
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