Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress group Post Reply Post New Topic
Author Message
bgovindhan
Newbie
Newbie


Joined: 14 Dec 2011
Location: United States
Online Status: Offline
Posts: 14
Quote bgovindhan Replybullet Topic: Suppress group
     Posted: 09 Jan 2012 at 9:33am
Hi,
 
I have a group total for each contract for each year. For example,
 
Contract    2011   2012   2013  2014  2015
 
BL125        125     0         0         0        0
 
I would like to suppress this rows, if the total for all the years is zero. In other words, I don't want to display the contract if each year total is zero.
 
Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jan 2012 at 9:46am
in order to suppress you will need to get the result via a summary function (or you would have to resort to sub reports)
you are grounping on Contract...
Are you grouping on year also or are these different columns on your data set rows?
You can likely either just do a SUM (or COUNT) of your record at the contract group level and suppressusing that result
or
create a formula to add each of the FY values togther for a row and then sum or count that at the contract group level and suppress on that result
IP IP Logged
bgovindhan
Newbie
Newbie


Joined: 14 Dec 2011
Location: United States
Online Status: Offline
Posts: 14
Quote bgovindhan Replybullet Posted: 10 Jan 2012 at 6:15am
Thanks for your reply. This is what I am doing.  I have a group header 1 based on table1.column1. Group header 2 based on formula which decidedes whether it is purchase or sales. Group header 3 based on contract number. The five fiscal year above are five formula fields F_vol1, F_vol2,F_vol3, F_vol4,F_vol5 for each year based on the yearly qty. So, the first row above is for contract number BL125. I have created another formula for total which is sum of f_vol1 through f_vol5. But, for some reason for some rows it shows correctly. For some rows, it shows zero even though i have values for f_vol1. It's confusing to me. Not sure what I am doing wrong.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2012 at 6:36am
what is an example of your year formulas (F_vol1)?
What is your formual for the total of this?
where (GH1, GF1, GH2, GF2, etc) are you placing the total formulas?
IP IP Logged
bgovindhan
Newbie
Newbie


Joined: 14 Dec 2011
Location: United States
Online Status: Offline
Posts: 14
Quote bgovindhan Replybullet Posted: 10 Jan 2012 at 6:44am
My formula for F_vol1 is as follows:
 
if year({VW_AE_VOL_COMMITMENTS.EFFECTIVE_DATE}) = (year({VW_AE_VOL_COMMITMENTS.REPORT_START_DATE}))
then if not isnull({VW_AE_VOL_COMMITMENTS.COMMITED_QTY}) then
{VW_AE_VOL_COMMITMENTS.COMMITED_QTY}
else
0
 
My formula for F_vol2 is as follows:
 
if year({VW_AE_VOL_COMMITMENTS.EFFECTIVE_DATE}) = (year({VW_AE_VOL_COMMITMENTS.REPORT_START_DATE})+1)
then if not isnull({VW_AE_VOL_COMMITMENTS.COMMITED_QTY}) then
{VW_AE_VOL_COMMITMENTS.COMMITED_QTY}
else
0
 
My formula for f_vol_total is:
 
 
The f_vol_total was placed under group header 3 which has something like this.
 
contract_no   f_vol1  f_vol2  f_vol3  f_vol4  f_vol5   f_vol-total
 
The funniest part is, for some of the rows f_vol_total shows up correctly. For some of the rows, f_vol_total shows zero even though one of the f_vols are not zero.


Edited by bgovindhan - 10 Jan 2012 at 6:46am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2012 at 6:56am
A few things here:
You can possibly simplfy this for your self by just using a Crosstab in GH3.
If you want to keep your process I would alter the formula a little:
There should be a toggle option in the FOrmula Editor that lets use the setting "use default values for Nulls". Then all you need is this:
if year({VW_AE_VOL_COMMITMENTS.EFFECTIVE_DATE}) = (year({VW_AE_VOL_COMMITMENTS.REPORT_START_DATE})) then
{VW_AE_VOL_COMMITMENTS.COMMITED_QTY}

Next you have to sum each of these at the Group level of contract no.

SUM(@F_vol1,table.contractno)
Note that Sums work in headers but Running Totals or variable formulas do not.
 
For debugging unsuppress your details section and place all of your formulas on the detail row to make sure each formula is getting the correct value per row. You may spot the error there more easily.
IP IP Logged
bgovindhan
Newbie
Newbie


Joined: 14 Dec 2011
Location: United States
Online Status: Offline
Posts: 14
Quote bgovindhan Replybullet Posted: 11 Jan 2012 at 5:07am
Thank you very much. Your trick worked. I did F_VOL_TOTAL as
 
 
Then, suppressed if zero. It works great! Thanks again.
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