Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group Total In Different Group? Post Reply Post New Topic
Page  of 2 Next >>
Author Message
meewally
Newbie
Newbie


Joined: 08 May 2009
Online Status: Offline
Posts: 5
Quote meewally Replybullet Topic: Group Total In Different Group?
     Posted: 08 May 2009 at 12:32pm
This is probably easy but my brain isn't working very well right now.
 
I am reporting payment information and my first group is a date. The second group is a payment type.
 
The detail line shows the amount in two columns - one marked Type 1 and the other marked Type 2. If the amount under the column for Type 1 is actually a Type 2, I suppress it based on the type, and vice versa.
 
I have a running total for the amount that resets on a group change, so within the group footer I can show a Type 1 total and a Type 2 total.
 
Is there a way to also show those same totals in the group footer for the date group ?  Does this make any sense ?
 
Thanks for any help...
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 May 2009 at 12:41pm
Try
 
{#Type1 Total} + {#Type2 Total}
 
-Dell
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 08 May 2009 at 12:45pm
Can you do a second running total and reset it on a date change ?  That way, the date running total should equal the sum of all the type running totals for that date. 
 


Edited by JohnT - 08 May 2009 at 12:53pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 May 2009 at 1:13pm

I would second John's suggestion with the caveat that you did not mention that your Running totals are conditionally including records based on the type="actual". Just because you suppressed something does not mean the RT will not include it in the summary. You would have to make sure you conditionally include these records at both Group1 and group2 directly in each of the RT fields.

IP IP Logged
meewally
Newbie
Newbie


Joined: 08 May 2009
Online Status: Offline
Posts: 5
Quote meewally Replybullet Posted: 14 May 2009 at 1:02pm
Thanks - yes that does calculate the correct  total; but I am still unable to pull out those inidividual totals into the next group (i.e. date) - it will only show/calculate whatever type was read last

Edited by meewally - 14 May 2009 at 1:03pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 May 2009 at 1:08pm
Originally posted by meewally

Thanks - yes that does calculate the correct  total;
I assume this is referenceing Hilfy's suggestino to add the two fields together.
 
 
Originally posted by meewally

but I am still unable to pull out those inidividual totals into the next group (i.e. date) - it will only show/calculate whatever type was read last
 
Did you create new running totals that reset at the Date group level and palce them in that group level footer?


Edited by DBlank - 14 May 2009 at 1:08pm
IP IP Logged
meewally
Newbie
Newbie


Joined: 08 May 2009
Online Status: Offline
Posts: 5
Quote meewally Replybullet Posted: 14 May 2009 at 1:45pm
Originally posted by DBlank

Originally posted by meewally

Thanks - yes that does calculate the correct  total;
Originally posted by DBlank

I assume this is referenceing Hilfy's suggestino to add the two fields together.
 
No - by this I meant your suggestion of conditional Running Totals
 
Originally posted by DBlank

Originally posted by meewally

but I am still unable to pull out those inidividual totals into the next group (i.e. date) - it will only show/calculate whatever type was read last
 
Did you create new running totals that reset at the Date group level and palce them in that group level footer?
 
I tried this 2 different ways and I get either a total of all payments (type 1 + type 2) or I get the total of only whatever type was read last (type 2)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 May 2009 at 1:54pm
Gotcha.
So you need help figuring out what is wrong with the totalling?
If so...
In your original post you state:
"The detail line shows the amount in two columns - one marked Type 1 and the other marked Type 2. If the amount under the column for Type 1 is actually a Type 2, I suppress it based on the type, and vice versa."
1. Without suppression what does the data look like?
2. How do you know if an item is Type 1 or Type 2? Is there a third column that is the indicator?
3. What is the formula you are using for your running total as your inclusion condition?
Thanks.


Edited by DBlank - 14 May 2009 at 1:54pm
IP IP Logged
meewally
Newbie
Newbie


Joined: 08 May 2009
Online Status: Offline
Posts: 5
Quote meewally Replybullet Posted: 15 May 2009 at 7:13am
Originally posted by DBlank

Gotcha.
So you need help figuring out what is wrong with the totalling?
If so...
In your original post you state:
"The detail line shows the amount in two columns - one marked Type 1 and the other marked Type 2. If the amount under the column for Type 1 is actually a Type 2, I suppress it based on the type, and vice versa."
1. Without suppression what does the data look like?
2. How do you know if an item is Type 1 or Type 2? Is there a third column that is the indicator?
3. What is the formula you are using for your running total as your inclusion condition?
Thanks.
Each record includes: DATE, AMOUNT, TYPE and there may be multiple records for a date that may have amounts of both types
desired output:(I do not include the actual Type field in the report)
 
headers                    DATE        TYPE_1_AMOUNT       TYPE_2_AMOUNT
date group(hidden)                 
type group(hidden)
detail(hide w/ drill)     ###         $$(supp if Type 2)         $$(supp if Type 1)
type group(hidden)                    Run_Total_if_Type_1     Run_Total_if_Type_2
date group                 ###             Type_1_Total                 Type_2_Total
 
Run_Total_if_Type_1 simply adds the Amount field if Type = 1
Run_Total_if_Type_2 simply adds the Amount field if Type = 2
In the footer for the type group, I am able to show the correct totals, but I would like to show a summary in the date group footer with a total for each type.
Because the amount in each record is independent of the type, I am only able to show the total for last type read.
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 May 2009 at 8:23am
OK. I think I see what is going on here. If you change your Running Totals to conditionally include items and Sum those you should be fine. I think you can also get rid of grouping 2 (type group) and keep all of your amounts together on one drill down under the date group. Note that suppressing items does not prevent them from being calculated in totals.
For the any of your running totals you can add a condition to to limit what it will include.
To get your Date level sum for type 1:
Add (or edit) a running total.
Name it something like "DateLevelType1"
Field to summarize is your type1 amount field.
Type of Summary is a SUM
Set the Evaulate for as "Use a formula"-in the formula put your condition for what you want to include the same way you were conditionally suppressing...{table.typefield}=1
Rest as Change of group at group level 1 (Date)
Place it on group footer 1
Do the same thing for type 2 but change it to evaluate the type2 field as a Sum and change your evaluate formula to{table.typefield}=2
 
If I understand your set up, this makes group level 2 unnecessary. I think the only reason you added it was so you could get the sums for each type. Conditionally including them in the RT will do the same thing.
Is this what you were trying to do?


Edited by DBlank - 15 May 2009 at 8:24am
IP IP Logged
Page  of 2 Next >>
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