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!

Suppressing data based upon a previous lines entry

Status
Not open for further replies.

JamesFlowers

Programmer
Mar 23, 2001
97
GB
hi.

I have a recordset that needs to suppress data based upon a line in the database. Normally, I would group by the description. but in this case the data is entered in by hand as below;


This quote is for the labour listed below. null
Engineering Eng Rate 0
Engineering Remote O/T Rate 0
Engineering O/T Rate 0
Engineering Technical Tech Rate 0
Engineering Remote 0
Engineering Technical 0
Handset M3904 100
Headset GN 100
Items Listed Below Require Customer Selection null
10216 IP115 handset 1 20
10199 IP212K handset 1 20
10197 IP230 handset 1 20
10146 IP560 handset 1 20


what I want to do is turn the records after the 'Items Listed Below Require Customer Selection ' from 20's into 0's and (which will contribute to a subtotal , and then suppress them, but leaving the descriptions intact.

each line has a different unique key_id against it.

NOTE I cannot group as there is no fields by which to do so.

MTIA

James

James Flowers
Crystal Consultant
 
I don't understand why you are converting the 20's to 0's instead of suppressing them directly. Or are you saying you don't want the 20's to be factored into totals?

Is it always the case that the rows where you want suppressed values start with a numeric field while the other rows do not? Also, is the Item ID field a number or a string?

-LB
 
the 20's are to be converted to 0 to contribute to the overall totals

the rows maynot start with a numericfield (if it were only that simple)

the key id is a number

James Flowers
Crystal Consultant
 
You could do something like the following. Create a formula to replace the value field;

whileprintingrecords;
numbervar x;
if {table.descr} startswith "Items Listed Below" then
x := 0 else
x := {table.value};

Then if you need to summarize the value, you could change the formula to:

whileprintingrecords;
numbervar x;
if {table.descr} startswith "Items Listed Below" then
x := 0 else
x := {table.value};
numbervar sumx := sumx + x;
x

Then in the report footer, use:
whileprintingrecords;
numbervar sumx;

If you want the summary at the group level, you would need a reset formula in the group header:

whileprintingrecords;
numbervar sumx;
if not inrepeatedgroupheader then
sumx := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top