Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Supressing Group with 0 total Post Reply Post New Topic
Author Message
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Topic: Supressing Group with 0 total
     Posted: 16 Jan 2009 at 8:05am
I want to suppress a group that has a sum of 0. I have tried the select group
Sum(field) <> 0 and the section expert suppress Sum(field) = 0

Neither is working. Does anyone have a solution?

Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jan 2009 at 8:40am

Use the Summary function to create a sum of the field at the appropriate group level you want to suppress on and then use that summary field as your condition to suppress on.

Sum ({field}, {groupfield})=0
IP IP Logged
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Posted: 16 Jan 2009 at 8:55am
That is what I did. Please see my first post. 

But I did find the solution.
In group selection:
not(sum(field) in 0.01 to -0.01) works




Edited by cfrey - 16 Jan 2009 at 12:01pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jan 2009 at 9:30am

Sorry but by your example code I thought you were not using the sum at the group level. This is very odd becuase I tested it using both a formula field to get the sum and the sum summary function and it suppresses fine on sum=0 for me.  I assume you validated that all of these have a 0 total in the group sum and none have null instead of zeros?

IP IP Logged
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Posted: 16 Jan 2009 at 12:01pm
Yes, all of my data had a zero sum. This has happened before with certain files and I'm not sure why. I had posted this question on a user group in the past and others had experienced the same. They had attributed it to fractions ( .0000001). But in this particular case I am just adding and subtracting 2 decimal places.  I have no answer other than the above formula worked.

Thank you for your help.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jan 2009 at 12:57pm
Thanks for the heads up on that oddity.
That is a really weird sum.
I wonder if rounding to no decimals when summing would also "fix" this...
Just weird.
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