Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Total in a group Post Reply Post New Topic
Author Message
natali
Newbie
Newbie
Avatar

Joined: 15 Jan 2013
Online Status: Offline
Posts: 26
Quote natali Replybullet Topic: Total in a group
     Posted: 20 Nov 2013 at 10:43am

How can I show the amount grand total of a column in each line of the group footer. When I copy the grand total to the group footer line it resets  the amount and shows as a cumulative by each group.

IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 20 Nov 2013 at 10:53am
use a formula like
Sum_formula:
sum(value)
instead of built-in summary option.
IP IP Logged
natali
Newbie
Newbie
Avatar

Joined: 15 Jan 2013
Online Status: Offline
Posts: 26
Quote natali Replybullet Posted: 21 Nov 2013 at 5:19am
thank you but this is not working for me
In my running total I excluded negative amounts in a group total and some  other groups that I specified.
So, how can I exclude all these when I am using sum(value)?
I tried using IF() then Sum () formula but it didn't work.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Nov 2013 at 5:37am
create the if then formula first then use the sum formula on the if then formula like
formula1
if value < 0 then 0 else value
formula2
sum(formula1)
IP IP Logged
natali
Newbie
Newbie
Avatar

Joined: 15 Jan 2013
Online Status: Offline
Posts: 26
Quote natali Replybullet Posted: 21 Nov 2013 at 5:57am
this is working.
Formula1: if Sum ({GL11110.PERDBLNC}, {GL11110.ACTNUMBR_2})<0 then 0
else Sum ({GL11110.PERDBLNC}, {GL11110.ACTNUMBR_2})
 
this is not working.
Formula 2: sum {@Formula1}. I get a message: This field cannot be summarized.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 21 Nov 2013 at 6:03am
crystal wont let you take a summary of a summary
and in this case you don't even need to.


Formula1: if {GL11110.PERDBLNC}<0 then 0 else
{GL11110.PERDBLNC}

Formula 2: sum {@Formula1}.

Edited by kostya1122 - 21 Nov 2013 at 6:08am
IP IP Logged
natali
Newbie
Newbie
Avatar

Joined: 15 Jan 2013
Online Status: Offline
Posts: 26
Quote natali Replybullet Posted: 21 Nov 2013 at 8:32am
thank you Kostya....
but I still get the message that this field cannot be summarized.
And your formula 1 is not what I need.  As I said the negative amount that is in a group total and not in details should be excluded. But when you do formula1 it includes everything.
Anyway, maybe there is another way to do my calculation.
I need to show the % on each line of group total (group total/GrandTotal)
My details are hidded and what I need on the report is group total and another column with %.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Nov 2013 at 11:10am
OK, since you are looking at totals of the group...

why don't you create a formula like:
local numbervar sm := sum({table.field}, {group});
if < 0 then
0
else
sm / sum({table.field});

or use the running total as the trigger instead of the sum for the group...I don't use running totals so I'll pseudo code

if rt < 0 then
0
else
rt / sum(table.field)

perhaps this is what you are looking for
IP IP Logged
natali
Newbie
Newbie
Avatar

Joined: 15 Jan 2013
Online Status: Offline
Posts: 26
Quote natali Replybullet Posted: 21 Nov 2013 at 11:24am
thank you. I will try
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