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

help for tricky problem

Status
Not open for further replies.

sameer11

Programmer
Jun 17, 2003
89
US
Hi All,

Here is a trick problem. Iam having trouble to hide the whole group section. Using CR 8 ver
when the following case occurs.
In have 5 fields
unit, category, col1,col2,col3.
A unit can have one or more than one category
Category as col1, col2,col3
col1, col2, clo3(results as 3types of flag--F,U and N)

Tricky part is:

I will have to hide the whole unit group when either col1, col2,col3 results as 'F' more than once for any one category of that unit. Below is sample
what iam doing is
1st grouping is done on unit
2nd grouping is done on category
and Iam underlying group1 and group2


unit category col1 col2 col3 //PH

100 cat1 F F N
cat2 U F U
cat3 u u u
// I need to hide or filter the whole group since col1,col2,col3 for cat1(category) results as 'F' more than once

200 cat3 u N u
cat4 u F N
// don't hide this

Thanks in Advance any help provied,

Sweetie pie
 
This is difficult. You need to work out what the group contains before deciding whether to suppress it. But because you are looking for two occurances of a value, summary totals will do no good.

The best solution I can think of it to duplicate the group details in a subreport, which you put in the group footer. Count the F values using a running total and suppress the group footer if it does not qualify.

THis will eat up a lot of machine time, but should work.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
I'm not sure why you have a group on category. Is there more than one record for each category? It looks like these are detail fields, not summaries. Anyway, if col1, col2, and col3 are fields, not summaries, then you could do the following. Create four formulas:

//{@col1F}:
if {table.col1} = "F" then 1

//{@col2F}:
if {table.col2} = "F" then 1

//{@col3F}:
if {table.col3} = "F" then 1

//{@total}:
if {@col1F}+{@col2F}+{@col3F} >= 2 then 1

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

sum({@total},{table.unit}) = 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top