Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: filter Post Reply Post New Topic
Page  of 2 Next >>
Author Message
psrs0810
Newbie
Newbie


Joined: 22 Apr 2009
Online Status: Offline
Posts: 15
Quote psrs0810 Replybullet Topic: filter
    Posted: 08 Jun 2009 at 12:39pm
How do you filter out (remove) all data that would normally come in with 0?
 
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 08 Jun 2009 at 1:30pm
Is is 0 or is it null?
 
In the Select Expert, select the field, "Is Not Equal To", and enter 0.
 
-Dell
IP IP Logged
psrs0810
Newbie
Newbie


Joined: 22 Apr 2009
Online Status: Offline
Posts: 15
Quote psrs0810 Replybullet Posted: 08 Jun 2009 at 1:35pm
How do I do that when there are 4 columns of information?
i.e. Actual Charges, Budget Charges, Actual Volume and Budget Volume
Also, some are posted with 0.00 while others are just blank
 
 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jun 2009 at 2:49pm
Sorry my original post was wrong...
Use or statements:
table.Actual Charges>0
or
table.Budget Charges>0
or
table.Actual Volume>0
or
table.Budget Volume>0
 
if any value is >0 it will include the record, if all are either null or =0 it will exlcude the record.


Edited by DBlank - 09 Jun 2009 at 7:39am
IP IP Logged
psrs0810
Newbie
Newbie


Joined: 22 Apr 2009
Online Status: Offline
Posts: 15
Quote psrs0810 Replybullet Posted: 09 Jun 2009 at 5:17am
where in crystal would put that statement?  That is the other part that I am confused about.
 
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 09 Jun 2009 at 7:20am

You can edit the formula in the Select Expert.  I would set up all four of the conditions there, edit the formula, and replace the "and" put there by the Select Expert with "or".  Note:  if you have set up other conditions in the Select Expert, you'll need to put parentheses around this set of OR conditions, something like this:

({table.Actual Charges}>0
or
{table.Budget Charges}>0
or
{table.Actual Volume}>0
or
{table.Budget Volume}>0)
 
-Dell
IP IP Logged
psrs0810
Newbie
Newbie


Joined: 22 Apr 2009
Online Status: Offline
Posts: 15
Quote psrs0810 Replybullet Posted: 09 Jun 2009 at 7:46am

Sorry, but I am new to Crystal.

Under Reports, is this formula going Selection Formulas, Record or group?
And what is the difference?
 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jun 2009 at 7:56am

Record. This is used to evaluate conditions that are per record (even if it is more than one criteria for that record like your statement is).

Group is used to select data based on a group condition like a SUM of a field a a group level or Count of a records in a group.
IP IP Logged
psrs0810
Newbie
Newbie


Joined: 22 Apr 2009
Online Status: Offline
Posts: 15
Quote psrs0810 Replybullet Posted: 10 Jun 2009 at 9:50am

What about filtering out a null or blank value?  There are some values that are less then 0.

 

Thanks

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jun 2009 at 10:10am
I guess this begs the question are you trying to exclude rows based on the sum of these 4 fields meeting a condition or are you trying to exclude records where at least 1 of the fields is >0 (which is how it is now).
The select statement is evaluating the record to see if each full condition = True (include record) or = False (exclude record).
By putting the parenth around all 4 parts of the "or statement" (above) it evaluates all of this as 1 statement so if any one of the part=true then the whole condition is TRUE and the record is included in the report.
 
The ">0 " evaluation would be FALSE (exclude) if the field is NULL or a field with a negative value. Therefore if all 4 fields were any of the following: null, 0 or negative, then the row is excluded.
if 3 are negative and 1 field has any positive number it is included.
Make sense? 


Edited by DBlank - 10 Jun 2009 at 10:13am
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.