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

Suppressing duplicates

Status
Not open for further replies.

Rob32

Technical User
Oct 14, 2002
18
NZ
Hi there

My apologies to begin with if this question is a little convoluted...

I am using CR 7.

I use a formula that concatenates records into one string, and splits the string when it gets close to the 254 char limit. It is as follows:
Code:
WhilePrintingRecords;
StringVar list;
StringVar list1;

If list="" then
list := {reg_product.description}
else If Length(list) <= 150 then
list := list  + &quot;, &quot;  + {reg_product.description}

Else if
list1=&quot;&quot; then
list1 := {reg_product.description}
else
list1 := list1 + &quot;, &quot; + {reg_product.description}

This formula sits in the details section (which is suppressed) and prints to 2 formulae placed in the group footer section:

The first formula is this:
Code:
WhilePrintingRecords  ;
stringVar  list;
stringVar  lastList;

lastList := list;
list := &quot;&quot;;
lastList
//listPrem;

The second formula is this:
Code:
WhilePrintingRecords  ;
stringVar  list1;
stringVar  lastList1;

lastList1 := list1;
list1 := &quot;&quot;;
lastList1

The problem I have is that these formulae do not suppress duplicate entries, and I don't want to be reporting the same product over & over. Duplicates do not necessarily follow each other. I am also using a similar set of formulae in the same report to output processing categories.

Any help would be greatly appreciated - thanks.
 
Not sure if this is what you mean, but:
You can insert the formula field onto the report, right click on it and check &quot;supress if duplicated&quot;

 
I should have said:
right click, choose format field --> supress if duplicated(which is under the common tab).
 
Faithful1 - thanks for your reply. I had tried that one, but it suppresses the whole field, rather than the individual values in it. So I end up with output something like this if not supressed (output as a string):

fish, cattle, deer, fish, fish

If there is another entry with the same output, then both are suppressed completly. So I need to suppress the duplicates before they are output into a string. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top