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

Suppress when Group 1 is not in detail field values 1

Status
Not open for further replies.

nilsbinnemans

Programmer
May 14, 2012
14
GB
Hi,

I have a reportdesign like this:

Group 1 {Period}
Group 2 {Event}
Details {Exclude_from_Periods}

A period can be numbered from 1 up to .... Every period has multiple events. These events can be excluded for 1 or more periods. But all events will always show up for each period.
It could look like this:

Period 1
Event 1
Excl period 2
Excl period 3
Event 2
Excl period 1

Period 2
Event 1
Excl period 2
Excl period 3
Event 2
Excl period 1

Period 3
Event 1
Excl period 2
Excl period 3
Event 2
Excl period 1

I want to suppress all the events wherefore the period number {Period} is equal to the {Exclude_from_period} number.
But when I put the {Exclude_from_Period} field in the {Event} group header it only gives the first number. How can I suppress it when {Period}is equal to any of the {Exclude_from_Period} values in the detail field?

thanks!

 
I'm not clear what you're after. Nor what your data structure is. But if you want to use. If {Exclude_from_Periods} is a dataset, you might get somewhere by adding it twice, the second addition creating an alias dataset that can be used independently.



[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Create a formula like this:

//{@hasexclperiod}:
if {Period} = {Exclude_from_period} then 1

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

sum({@hasexclperiod},{table.event})=0

Note that if you need to do calculations across event groups, you need to use running totals, since non-group selected values are still "in" the report, though not appearing, and would contribute to the more usual inserted summaries.

-LB
 
That is working fine.
I had to add
IF isnull({Exclude_from_period}) then 0
because is has some null values in it. And then the event wouldnt show up.

Thank you
Nils
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top