Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sum of first five values gropu wise Post Reply Post New Topic
Author Message
ankita
Newbie
Newbie


Joined: 13 May 2011
Online Status: Offline
Posts: 37
Quote ankita Replybullet Topic: Sum of first five values gropu wise
     Posted: 06 Jan 2013 at 3:53pm
Hi TEam

Pls tell me



WE need to calculate the sum of first five values for each group

####
Grup1
2.00           
2.00     1/1/2013 12:00:00 AM     18.87
2.00     1/1/2013 1:00:00 AM     17.67
2.00     1/1/2013 2:00:00 AM     17.68
2.00     1/1/2013 3:00:00 AM     17.82
2.00     1/1/2013 4:00:00 AM     17.90
2.00     1/1/2013 5:00:00 AM     18.01
2.00     1/1/2013 6:00:00 AM     18.10
2.00     1/1/2013 7:00:00 AM     18.16
2.00     1/1/2013 8:00:00 AM     17.39
2.00     1/1/2013 9:00:00 AM     17.51
2.00     1/1/2013 10:00:00 AM     17.64
2.00     1/1/2013 11:00:00 AM     17.73



Grup2

######
3.00           
2.00     1/1/2013 12:00:00 AM     8.87
2.00     1/1/2013 1:00:00 AM     7.67
2.00     1/1/2013 2:00:00 AM     7.68
2.00     1/1/2013 3:00:00 AM     7.82
2.00     1/1/2013 4:00:00 AM     7.90
2.00     1/1/2013 5:00:00 AM     18.01
2.00     1/1/2013 6:00:00 AM     8.10
2.00     1/1/2013 7:00:00 AM     18.16
2.00     1/1/2013 8:00:00 AM     7.39
2.00     1/1/2013 9:00:00 AM     17.51
2.00     1/1/2013 10:00:00 AM     17.64
2.00     1/1/2013 11:00:00 AM     17.73
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 06 Jan 2013 at 11:03pm
Hi

You need to create 3 formulas to achieve this :

1.

@init
Whileprintingrecords;
Numbervar no:=0;
Numbervar tot:=0;

//Place this formula in your group header

2.
@accu
Whileprintingrecords;
Numbervar no:=no+1;
Numbervar tot;

if no <=5 then
tot:=tot+{yourfiledvalue};
//Place this on your detail section

3.
@disp
Whileprintingrecords;
Numbervar tot;

// place this on your group footer

You can suppress first 2 formulas.





Thanks,
Sastry
IP IP Logged
ankita
Newbie
Newbie


Joined: 13 May 2011
Online Status: Offline
Posts: 37
Quote ankita Replybullet Posted: 07 Jan 2013 at 4:56am
i am getting errror remainig text doesnot appear to be part of the formula..........pls help....how to place it in the group header formula section pls tell
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 08 Jan 2013 at 1:43am
hi

Have you included '@init' in your formula ? If so, remove that and try.

Still your getting the error, then can send your report on

sastrydsvs@gmail.com



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