Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: doing sum after applying group by Post Reply Post New Topic
Author Message
amit_reports
Newbie
Newbie
Avatar

Joined: 07 Feb 2008
Location: India
Online Status: Offline
Posts: 1
Quote amit_reports Replybullet Topic: doing sum after applying group by
    Posted: 07 Feb 2008 at 5:43am
Hi,
 
I need to modify a report, need to do sum of some fields by applying group by on some fileds of a table. But, after applying the group by and inorder to do the sum, created a new formula which sums the field of the table. like Sum({TABLENAME.COLUMNNAME}), but prob is this formula is adding all the records, I think it is skipping the group by clause which has added. Please let me know what is the correct way to do it.
 
Thanks,
Amit
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 07 Feb 2008 at 7:26am
That's because you're telling the SUM to ignore the group.  Embarrassed

If you use SUM( {TABLENAME.COLUMNNAME}, {TABLENAME.GROUPNAME} ), then it will give you the Sum of the values over the current group.  If you need to reference this by group in, say, the report footer, you will need to store the values in a global variable.
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.016 seconds.