Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Applying a formula to a group Post Reply Post New Topic
Author Message
AmandaH
Newbie
Newbie
Avatar

Joined: 17 Aug 2011
Online Status: Offline
Posts: 7
Quote AmandaH Replybullet Topic: Applying a formula to a group
    Posted: 17 Aug 2011 at 10:03am
I currently have a stored procedure that I am looking for totals from a previous system version and the new version. In Crystal I have created formulas to sum up each column. I have these columns listed per Orderno grouping. My problem is the formula is summing up all the orderno's totals for each column and not changing per group. I cannot do a running total for this. Here is an example of one of the formulas:
 
IF {SP_LegalItemizedBill.OrderNo} < 1500000
THEN {SP_LegalItemizedBill.InsARAppliedB4V2}
ELSE sum({SP_LegalItemizedBill.InsARApplied})
 
What I'm doing here is if an orderno < the 1500000 then pull totals based off the calculated field for orders in the old version of the system. If the orderno > 1500000 then I want to show the new version total (the old version is based off Order transactions and the new version is based off Line Item transactions). My report is showing each Line Item in an order, but I do not want the old version total for the order to repeat on each line item (therefore I have to use a formula instead of a running total).
 
In a running total I can Reset 'on change of group' and then select the OrderNo group. How do I do something similar with a formula?
 
Thanks!!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 17 Aug 2011 at 12:25pm
Try changing your sum like this:
 
sum({SP_LegalItemizedBill.InsARApplied}, {ordno group field})
 
-Dell
IP IP Logged
AmandaH
Newbie
Newbie
Avatar

Joined: 17 Aug 2011
Online Status: Offline
Posts: 7
Quote AmandaH Replybullet Posted: 18 Aug 2011 at 4:18am
Awesome, thank you!!!Smile
IP IP Logged
AmandaH
Newbie
Newbie
Avatar

Joined: 17 Aug 2011
Online Status: Offline
Posts: 7
Quote AmandaH Replybullet Posted: 18 Aug 2011 at 8:30am
Have a question about the Grand Totals for these columns. Since the old version is based on Order Transactions, when I create a formula for the grand total it is duplicating the order total based on how many line items are in the order. For my example there are 3 line items in one order and the order total is $524.00. It is adding that up 3 times and then adding the order total for the next order grouping (2nd order total is $79.13). So my grand total is = $1651.13 when it should be $603.13. Here is a copy of the Grand Total formula:
 
IF {SP_LegalItemizedBill.OrderNo} < 1500000
THEN sum({SP_LegalItemizedBill.InsARAppliedB4V2})
ELSE sum({SP_LegalItemizedBill.InsARApplied})
 
This is the formula I used to get each orderno group total:
 
IF {SP_LegalItemizedBill.OrderNo} < 1500000
THEN {SP_LegalItemizedBill.InsARAppliedB4V2}
ELSE sum({SP_LegalItemizedBill.InsARApplied},{SP_LegalItemizedBill.OrderNo})
 
Anyone know how I get the old version order total to not duplicate for my Grand Total?
 
Thanks!!!
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.015 seconds.