Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: SUM by group Post Reply Post New Topic
Author Message
MikeTex
Newbie
Newbie


Joined: 05 Nov 2012
Location: Portugal
Online Status: Offline
Posts: 4
Quote MikeTex Replybullet Topic: SUM by group
    Posted: 05 Nov 2012 at 11:46am

I have a question that I need help.
I have a report that contains 3 groups:
1st Group -> Account
2nd Group -> Account Like'6*'
3rd Group -> Account Like'7* '
The 2nd group footer gives me a sum for each account started by '6'
The 3rd group footer gives me a sum for each account that begins with '7'

I need to get the report the way you describe:
2nd Footer Account Like'6 * 'containing the sum of all footers account Like'6 *'
3rd Footer Account Like'7 * 'containing the sum of all footers account Like'7 *'

For now exemplified what I'm getting.

61 - 500.00
Total - 1000.00
62 - 250.00
Total - 1000.00
69 - 250.00
Total - 1000.00

What I need is:

61 - 500.00
62 - 250.00
69 - 250.00
Total - 1000.00
71 - 1000.00
73 - 500.00
78 - 500.00
Total - 2000.00

Grand Total - 3000.00

Mike Teixeira
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2012 at 1:58pm
Create a formula field to group on and then insert a sum at the group level and another at the report footer level.

Your formula for grouping will depend on the field type of the "numbers".
If field like '6*' then '6x' else
if field like '7*' then '7x' else 'other'
IP IP Logged
MikeTex
Newbie
Newbie


Joined: 05 Nov 2012
Location: Portugal
Online Status: Offline
Posts: 4
Quote MikeTex Replybullet Posted: 06 Nov 2012 at 7:22am
Thank's DBlank,
 
I have already a field to group the numbers, my problem is only:
 
The data that starts with 6 is grouped correctly;
The data that starts with 7 is grouped correctly;~
 
But i can't Sum each group like this:
 
Group '6*'
SUM Group '6*'
 
Group '7*'
SUM Group '7*'
 
Grand Total ('6*'+'7*')
Mike Teixeira
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2012 at 8:06am
just click on the field you want to sum
click on the sigma sign (blue E)
select the type as a sum
select the location as the group footer
it will create a summary that wikl appear on the group footer
This will only sum rows that fall into each group
the formula looks like this
SUM({table.value},{table.groupfield})
 
repeat the process for the grand total
it will palce the summary in the report footer
the formual look like
sum({table.value})
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.