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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing an entire group if criteria not met

Status
Not open for further replies.

jewilson2

Technical User
Feb 7, 2002
71
0
0
US
Hello. I am trying to write a report showing only records that meed certain criteria.

I have a table with employee number and pay code for instance. The employee record is repeated for every pay code record. I have grouped by employee, and listed the paycodes in that group. The problem is, I only want to see records where pay code =910 and/or =990.
If they have 990 only i want to see it.
If they have 990 and 910 i want to see it.
If they have 990 and paycodes other than 910 i don't want to see it.
If they have 990, 910 and other paycodes i don't want to see it.

I can't use the select expert because if i set that equal 910 or 990 then it will pull only those records even if the employee has additional paycodes. The evaluation has to happen after ALL of the records have been pulled into the report. I wrote running totals to count the 990 and 910 paycodes for each employee group and to count the total number of different paycodes for each employee group. I then tried to suppress each section based on a comparisong of these results. The problem is, i can't evaluate group selection on running totals because the totals aren't computed until the data is pulled.

Question is....

How can i see all employees (grouped) that have either 910 only, 990 only, or 910 and 990 only?

Sounds simple but I can't figure it out.

Thanks in advance
 
I don't understand. If you used report record selection to exclude everything except 910 or 990, what would you lose that you needed?

If it is a distinct function, additional to something needed for each employee, then I'd recomend a subreport. Subreports make a lot of work for computers, but save time for humans. You decide which is more important for your particular circumstances.

Where I work, we go to a lot of trouble to make our mainframe screens and reports run efficiently. We use Crystal mostly for investigations and management information, cases where it doesn't much matter if a job takes twice as long because the user can be doing something else in the meantime. For a big Crystal report that is run frequently, it would be worth going to some trouble to make it efficient. In other cases it makes sense to save programmer-time.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Group on {table.employee} and then create a formula {@not910990}:

if not({table.paycode} in [910,990]) then 1 else 0

Then go to edit selection formula->GROUP and enter:

sum({@not901990},{table.employee}) = 0

-LB

 
Thanks LB....that works like a champ.

Love this place :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top