Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: exclude number if condition met Post Reply Post New Topic
Author Message
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Topic: exclude number if condition met
     Posted: 24 Jul 2012 at 3:44am
I have a report that lists our orders for the day. It groups them by the hour and I have a subtotal for each hour in the GF. When we have a new item the number is flagged so they can research it. The problem I have is that I need the report to not count this number in the hourly subtotal if it is a new item. I was able to get a formula to work if the order with the new item was the last order of the hour otherwise it added the number.
 
 
Thanks for the help
KevV
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 24 Jul 2012 at 5:00am
you would need to build the subtotal yourself...or keep track of all records that you want to remove, then in your formula for displaying the subtotal you would subtract the removal amount.
 
for example.
somewhere, a group footer for the order (at least that is where I would put it), if it contains a new item:
shared numbervar newItem;
newItem := newItem + 1;
""//hide the increment
 
in the report group footer (or whichever footer)
shared numbervar newItem;
count({table.field}, {group}) - newItem
 
or something along these lines.
just trying to suggest a path.
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 24 Jul 2012 at 11:46am
I have tried a few things but nothing has worked yet using those formulas. I am not quite sure which ({table.field}) or ({gorup}) to use. In the report I do have a formula  in the GF that counts all the items and totals how many different new items there are:
 
cstr( {#Count_New}   ,0,"")
 
but I need to count how many total items there are
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