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 a section based containing at least one tested value

Status
Not open for further replies.
Apr 11, 2008
68
GB
Hi

Using CR2008

I am preparing a report listing invoice values, where each invoice has the total broken down into several 'detail' lines by nominal code.

The report groups all 'detail' lines by 'invoice number', but I need to suppress groups based on testing the values within the group.

As an example.

Invoice 1:
Detail 1 - nominal code 35052 - VAT
Detail 2 - nominal code 65965 - goods A
Detail 3 - nominal code 12563 - goods B

Invoice 2
Detail 1 - nominal code 35052 - VAT
Detail 3 - nominal code 65885 - goods C


Now, in this example, I want to suppress Invoice 2, as it does not contain a detail line referencing the nominal codes for 'goods A' or 'goods B'.

I can easily suppress 'goods A' or 'goods B' through a selection formula based on the Nominal Code, but that still leaves the VAT line showing, so I want to know how to suppress the invoice completely based on it not containing certain SPECIFIED nominal codes.

Any guidance gratefully accepted!

Thanks in anicipation.

 
Create a formula {@hasval}:

if {table.code} in ["goods A","goods B"] then 1

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

sum({@hasval},{table.invoice}) > 0

This will display all groups containing goods A or B. If you need to do calculations across groups, you must use running totals, since non-group-selected records are still in the report and will contribute to the usual summaries. You don't have to do anything in the running total to exclude non-group-selected records. They just won't contribute to the calcuations.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top