Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppress a line with summed zeros Post Reply Post New Topic
Author Message
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Topic: Suppress a line with summed zeros
     Posted: 08 Jul 2013 at 4:30am
Hello all,
 
Hope you can help!
 
I have a report which shows the weight of forecasted product sold per month for a rolling year.
due to the nature of the product many of the lines are empty as we don't expect to sell any of them during this year, but I can't stop it showing all the zeros in the report.
 
the line data is fetched with 
If Date(Year({CASE_VOLUME\\.MSDATE}),Month({CASE_VOLUME\\MSDATE}),1)=date(year(currentdate),month(currentdate),1) THEN ({CASE_VOLUME\\.FORECAST_CASE_QTY})*{INVENTORY_PART\.WEIGHT_NET}
 
this is grouped and displayed by part number and the totals are summed by month.
 
I would like to suppress the whole line if all the sums of the forecast qty sales are zero for every month.
 
i have tried to suppress if Zero, but that just hides the value and not the line.
 
I'm probably missing something obvious!  but any help appreciated.
 
Many Thanks in advance
Gav
 
 


Edited by gemcka - 08 Jul 2013 at 4:31am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jul 2013 at 4:54am
a little confused as to your summed by month as the formula you showed is only looking at one month of data.
in general you can sum the value at the part group level and do a conditional suppression, or likely you could more successfully use a group exclusion.
in the select expert switch it to group select statement and use:
sum(formula,partnumber)>0
 
Excluded group data is still in the main report and will show in group trees and summarized level data (if it did not you could not use it a s a group summary select statement field).


Edited by DBlank - 08 Jul 2013 at 4:55am
IP IP Logged
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Posted: 08 Jul 2013 at 11:50pm
Yes sorry - should have said that there is a formula for each month  - just adding 1 to the month and performing another sum - the report basically looks like this:
Part_No  Desc   July  Aug  Sep  Oct   Nov ........... for 12 months        totals
401ty    desc      0      0      0      0       0      0    0   0    0                    0
401ut     desc    500   900   0     100   200    0      100 0  50   100        2,300
 
I only want to show the lines that are not all 0's.
 
the formula in the totals field looks like this:
Sum ({@month now},{Case_Volumne\\.Part_no}) +Sum({@month+1,{Case_volume\\.Part_no})..... etc for each of the 12 months
 
Can I make the select on the totals field if it is >0?
 
If I pick this field in the group select and use >0 I get an error that it cant be done and must be evaluated later?
 
 
Many Thanks
 
 
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jul 2013 at 3:40am
I am still not sure if what I am looking at is a group footer or a detail section or something else.
In general though you can rethink the total. The total is really just the sum of another formula looking at the full 12 months
//full12months
If Date(Year({CASE_VOLUME\\.MSDATE}),Month({CASE_VOLUME\\MSDATE}),1) in dateserial(year(currentdate),month(currentdate)-12,1) to date(year(currentdate),month(currentdate),1)
THEN ({CASE_VOLUME\\.FORECAST_CASE_QTY})*{INVENTORY_PART\.WEIGHT_NET}
use the sum of it at the group level to look for it to be >0
 
Sum ({@full12months},{Case_Volumne\\.Part_no}) >0
IP IP Logged
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Posted: 09 Jul 2013 at 3:56am
Yes!!!
 
re-thinking the way the totals were summed was indeed the key.
 
I could then add it to the group selection formula!
 
Many Thanks for your help!
 
ClapClapClap
 
there a loads of other reports I can use this re-think on too!!
 
cheers
 
Gav
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