Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Summing Formulas Post Reply Post New Topic
Author Message
rowcpa
Newbie
Newbie


Joined: 19 Jun 2007
Online Status: Offline
Posts: 10
Quote rowcpa Replybullet Topic: Summing Formulas
     Posted: 17 Apr 2009 at 6:40am
I have a report with 5 levels of grouping.  The details section is completely suppressed.  The subtotal of the details in group footer 5 appears to a viewer of the report to be the lowest level of detail.
 
In addition to having a subtotal in group footer 5, I also subtotal the details in group footer 4.  In an adjacent column of the report I use a formula to calculate the % each subtotal in group footer 5 is of the subtotal in group footer 4.
 
My report then has an addition column of data in the suppressed details section with the subtotals again in footer 4 and 5.
 
Next I apply the percentages calculated above to the subtotals of the second set of details in group footer 5.  What we are doing here is showing the current year's budgeted tuition by residency/load and applying last year's mix of residency load to this year's data so I can seperate the difference between one years tuition budget due to residency mix as opposed to enrollment growth.
 
My issue is I can not show a subtotal in group footer 4 of my calculations in group footer 5 that multiplies the calculated percentages by the second set of details.  There is no details section to sum.  If a user selects the sum function with your active object being a formula or a subtotal sum is not one of the available functions in the drop down list. 
 
My solution was to write a formula that simply adds the formulas in group footer 5.  This does not work.  The results obtained from this formula is the bottom item only from the set of formulas I ask Crystal to add.
 
I am sure other people have had similar issues and hopefully can help.  I don't even really need the subtotal I am trying to get.  It is just these reports go on to a bunch of older CPAs with little by way of computer skill.  They will expect to see a subtotal just because it seems like there should be one and can't understand it's not like Excel where you can just add anything.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Apr 2009 at 6:40am
As you noticed you can't sum a formula.  I'm a bit confused by the description, but how I get around this issue is to create my own running totals and display them where I need them.  If I need a sum from group 5 to appear in group 4, I will create a shared variable that is set to 0 in the group 4 header, incremented in the group 5 footer and displayed in the group 4 footer.  It seems like there should be an easier way, but I don't know of one and no one has offered one, so what is one to do ;)
IP IP Logged
rowcpa
Newbie
Newbie


Joined: 19 Jun 2007
Online Status: Offline
Posts: 10
Quote rowcpa Replybullet Posted: 20 Apr 2009 at 7:18am

Thanks, I had resolved this problem before in a slightly different context and for got I knew how to do this  :)

I resolve with constructs

First a summary placed in the report and supressed:

 
Global numbervar MixImpactFPIS;
Global numbervar MixImpactFPOS;

IF {Crystal_Reports_Source_for_Parameters_GNBN.Residency}="In State"
and
{Crystal_Reports_Source_for_Parameters_GNBN.Section Code}='FP'
then MixImpactFPIS:={@Residency Mix Impact In State FP}
ELSE
IF {Crystal_Reports_Source_for_Parameters_GNBN.Residency}="Out Of State"
and
{Crystal_Reports_Source_for_Parameters_GNBN.Section Code}='FP'
then MixImpactFPOS:={@Residency Mix Impact Out Of State FP}

then the actual calculation:
 
 
Global numbervar MixImpactFPIS;
Global numbervar MixImpactFPOS;
Global numbervar MixImpactFPT;
IF {Crystal_Reports_Source_for_Parameters_GNBN.Residency}="In State"
and
{Crystal_Reports_Source_for_Parameters_GNBN.Section Code}='FP'
then MixImpactFPIS:={@Residency Mix Impact In State FP}
ELSE
IF {Crystal_Reports_Source_for_Parameters_GNBN.Residency}="Out Of State"
and
{Crystal_Reports_Source_for_Parameters_GNBN.Section Code}='FP'
then MixImpactFPOS:={@Residency Mix Impact Out Of State FP};
MixImpactFPT:=MixImpactFPIS + MixImpactFPOS

 



Edited by rowcpa - 20 Apr 2009 at 7:20am
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