Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I surpress 0 values? 2

Status
Not open for further replies.

loveyoursite

Technical User
Apr 14, 2005
100
US
CRV10 - I have the following formula:
IF {EMPLOYEE.DATE_HIRED} < {?Stop Date} AND ({EMPLOYEE.TERM_DATE} = #1/1/1700# or {EMPLOYEE.TERM_DATE} > {?Stop Date}) then
1
else
0

If the result is 0, I would like the record suppressed. Is there a way to do this?

Example for March 1 thru March 31:
Jones, Debra hire date 06/10/1990 1
Red, Greg hire date 05/16/2005 0
Tresha, Ali term date 01/29/2004 0

I would like for the o's to be surpressed and only show on the report Jones, Debra hire date 06/10/1990 1

I have inserted a group for this field but I don't know how to surpress if the group is 0 and leave the group if it is 1.

Thanks!
 
Right click the field > format / number / customize / check suppress if zero.
 
Thanks for the quick response. That worked and suppressed the single field, but how would I get the entire row to suppress? In my example above, I only want to see Jones, Debra on the report. Red,Greg and Tresha, Ali would be hidden. Thanks!
 
Sorry, I was only paying 50% attention there...

Go to Format Section in your Details section, and through the Suppress X+2 button, apply the condition {YourFormula} = 0.

This will apply a conditional suppression at the record level to hide records with 0 values.

Naith
 
If you are referring to only showing the names and info for persons which match your criteria and not showing any info for those which result in 0, based on your formula, then best way may be to suppress the section showing the details above (Format section -> suppress) and click on the formula icon to the right of where it says suppress, then enter:
(@yourformulanamehere) = 0

That should then only show:

Jones, Debra hire date 06/10/1990 1

Obviously you can then get rid of the formula entry in the report itself to leave it showing

Jones, Debra hire date 06/10/1990

if required.
 
Actually, that's a fair point that got nearly touched on:

If you're never going to be interested in people falling outside this criteria:

IF {EMPLOYEE.DATE_HIRED} < {?Stop Date} AND ({EMPLOYEE.TERM_DATE} = #1/1/1700# or {EMPLOYEE.TERM_DATE} > {?Stop Date}) then
1
else
0

you should actually have this bit:

{EMPLOYEE.DATE_HIRED} < {?Stop Date} AND ({EMPLOYEE.TERM_DATE} = #1/1/1700# or {EMPLOYEE.TERM_DATE} > {?Stop Date})

in your selection criteria, and not bring the records back in the first place, rather than bring them back and then hide the records you don't need.

Naith
 
Thanks so much Naith. That worked! Can you help me out just a step further? No that I see all of the group surpressed, that's not exactly what I should have asked for.
In this Group that contains the 0 records, there is a hired date and a term date for each employee record. I want to supress all 0 records that have a hired date greater than the report parameters stop date (entered by the user) AND supress the records that have a term date that is less than the start date or greater than the stop date (entered by the user).
Will this be too complex? Thanks again!
 
Why do you need these records in the report at all? Would it not be easier to just drive the report off the parameter dates in your selection criteria?

Either way, can you spin me an example of what you currently have and what you're trying to do?

Naith
 
Thanks Naith. This is a monthly turnover report, running from the first day of the month through the last day of the month. The report is suppose to show turnover for the time period AND the users want to see who terminated during that one month period. So the terms need to show on the report which is why I set the formula to give them a count of 0. My initial question came about because when I sent a sample of the report out, the users said they did not want to see any of the old terminations (other than those within the reporting month) and they do not want to see any of the new hires beyond the reporting month. I had set the formula to show them as 0 as well. So in a nutshell, I want to show a list of all current employees, including those who terminated during the month. Maybe I'm making this too hard. One last thing. The term date field contains 1/1/1700 default if there is no term date.
 
Naith is correcting in approaching this from the selection criteria,

It would be easier for you if the termination date field just showed a null value.

I think I follow what you mean by daying that you still want to list all those who were employed at some point during the report period (or indeed still are) but you alse want to flag those which may have a term date falling in the same period?

Set up 1 x date range parameter ?DATERANGE and also 1 x fomula @ENDDATE

//@ENDDATE
maximum(?DATERANGE)

In the selection criteria add:

//Check for those hired before end date and still employed
({employee.date_hired} < @ENDDATE and {empoloyee.term_date} = #1/1/1700#) or
//employed < end date and term date within report period
({employee.date_hired} < @ENDDATE and {employee.term_date} in ?DATERANGE)


You can then still use the formula you listed in the first post to highlight those which are showing a term date within the report period by simply copying the second part of the above criteria to use as a if then else formula

If this is not possible as you are wanting to report on uses whom fall outside these categories then maybe consider a subreport for the employee information?

Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top