Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sum of a Formaula Post Reply Post New Topic
Author Message
useless
Newbie
Newbie


Joined: 21 Sep 2012
Online Status: Offline
Posts: 3
Quote useless Replybullet Topic: Sum of a Formaula
     Posted: 25 Mar 2013 at 3:33am
My setup is as follow:
Group 1 : Store Number
Group 2 : Item

in Group 2 I have an formula to determine the Gross sales.
@grossales
if {@returns} <> 0 then
(({@unitsold} * {SINVOICED.NETPRIATI_0}) - {@returns})
else ({@unitsold} * {SINVOICED.NETPRIATI_0})


@returns :
{@unitsreturnedtot} * {SINVOICED.NETPRIATI_0}

@unitsreturnedtot
SUM({@unitsreturned},{ITMMASTER.X6_STYLE_0})

@unitsreturned
if {SINVOICE.SIVTYP_0} = 'INV'
    then 0
else if {SINVOICE.SIVTYP_0} = 'CRV'
    then {SINVOICED.QTYSTU_0} * -1      


I now want to Sum the total in Group2 and put the value in Group 1 header.
the formula I am trying is. I get an error stating that a field can not be summarized.

SUM(@grosssales,@stores)    
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 25 Mar 2013 at 10:32pm
Hi

You can use running totals to arrive this summary, but you can't place this summary on group header 1. May be you may have to use gorup footer to display this values.

Try the following running total formula :

Whileprintingrecords;
Numbervar x:=0; // Place this on your group header 1

Whileprintingrecords;
Numbervar x:=x+SUM(@grosssales,@stores) // place this on your group 2 where you have summary.

Whileprintingrecords;
Numbervar x;      //Place this on group footer 1

This will sum your grossales



Thanks,
Sastry
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