Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Running Total Feature Post Reply Post New Topic
Author Message
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Topic: Running Total Feature
     Posted: 13 Aug 2010 at 9:15am
I am trying to get a final total from a group using a Running Total yet that field does not appear as a field I can run a total on.  Is it possible to use running totals on summary fields?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Aug 2010 at 11:27am

not directly but usually you can create multiple running totals to evalaute teh same data but display totals at dfferent group levels. It is the same idea just a different way of executing the data reads.

IP IP Logged
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Posted: 13 Aug 2010 at 3:32pm
I do have groups already and what I am doing is taking two group totals and trying to total a group total.  Hard to explain.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Aug 2010 at 4:09pm

can you post sample rows, your group structure and your desired calculations?
IP IP Logged
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Posted: 16 Aug 2010 at 12:40am
Here is just a sample:
 
Sum of Commission Sales
 
Then I have a Formula field in the summary area for what the total commissions for that invoice are.  Because that is not a detail line, I can't get it to give a grand total of the commissions.  Also, this same Formula field does not show up when I try to choose it in a running total.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Aug 2010 at 3:34am
Sorry but I need to see actual row level data to help. You can mock in numbers and names if it is confidential data. i just need to understand the structure of the data and then how you want the row level data calculated without any of your formulas or with the formula written out so I know what it is doing.

Edited by DBlank - 16 Aug 2010 at 3:35am
IP IP Logged
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Posted: 16 Aug 2010 at 3:50am
There is no problem giving you the data you need to help with my problem.  I just don't know how to post what you are looking for?  Is there a way to email you the query or even what the page looks like?  I am unaware how to post they way you need me to.
 
Group Footer 2a has the field Sum of @Comm Sales.  There is also the field Sum of @Comm Sales Cost.  I was able to create a Formula Field @New Comm which has this written in it:
 
if {@Comm Sales Order Pft%} <0 then {@Commission} else
if {@Comm Sales Order Pft%} in (.0001 to 9.9999) then {@Commission}*.5 else
if {@Comm Sales Order Pft%} in (10 to 14.9999) then {@Commission}*.667 else
if {@Comm Sales Order Pft%} >=50 then ({@Commission}+({@Commission}*.33)) else
{@Commission}
 
@Comm Sales Order Pft% is calculated the following way:
if Sum ({@Comm Sales}, {wbw_line.SHIP_NUMBER})=0 then 0 else (Sum ({@Comm Sales}, {wbw_line.SHIP_NUMBER})-Sum ({@Comm Sales Cost}, {wbw_line.SHIP_NUMBER}))/Sum ({@Comm Sales}, {wbw_line.SHIP_NUMBER})*100
 
@Commission is calculated the following way:
if {customer.ACCT_GROUP_CVU}<>0 then (Sum ({@Comm Sales}, {wbw_line.SHIP_NUMBER})-Sum ({@Comm Sales Cost}, {wbw_line.SHIP_NUMBER}))*.2 else
(Sum ({@Comm Sales}, {wbw_line.SHIP_NUMBER})-Sum ({@Comm Sales Cost}, {wbw_line.SHIP_NUMBER}))*.3
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Aug 2010 at 4:40am
The above helps. You will not be able to use running totals to sum the above. The reason is that crystal only makes so many passes over the data and there is no pass late enough with a Running total to sum a sum.
You might try and rethink how youa re getting the group level data and do your calcualtions at the row level and then SUM these formula fields at the group levels.
for example:
@Commission is calculated the following way:
if {customer.ACCT_GROUP_CVU}<>0 then (Sum ({@Comm Sales}, {wbw_line.SHIP_NUMBER})-Sum ({@Comm Sales Cost}, {wbw_line.SHIP_NUMBER}))*.2 else
(Sum (
{@Comm Sales}, {wbw_line.SHIP_NUMBER})-Sum ({@Comm Sales Cost}, {wbw_line.SHIP_NUMBER}))*.3
Could be
({@Comm Sales}- {@Comm Sales Cost})*
(if {customer.ACCT_GROUP_CVU}<>0 then .2 else .3)
and then sum this at the wbw_line.SHIP_NUMBER group level.
Is this helping?
IP IP Logged
Martyb260
Newbie
Newbie


Joined: 13 Aug 2010
Location: United States
Online Status: Offline
Posts: 8
Quote Martyb260 Replybullet Posted: 16 Aug 2010 at 4:47am
The problem I am having is that they want to now pay commissions on the total sale and not on the item level which is what we had been doing previously.  The reason for this is that we do sell some assembly items which show a zero selling price with a cost showing negative profitability and then the main item showing a very high profitability.  We need that to be totaled and the only way to do this is to get a sum of the total invoice.  It is not that complicated mathwise, just creating a Crystal that will do the math.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Aug 2010 at 10:42am
I understand what the gyst of the issue is. What I am trying to explain to help you is that you cannot sum something that is already a sum but you can sum the original data differently.  It seems like it would be easy to do because you can see the data so why can't the system sum it.
Because when it creats the sums the sum does not exist. But the data that gave you the original SUm does exist, so basically can you get to the same end result only using the original data as it exists before you start to do calculations?
You wanted to know what to post for data.
What I need is row level sample data and then what the 'ruels are for calculating that row level data'.
Sorry if these seems so vague but it is really hard to explain why something that look so simple is not.
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