Skip to Content
0
Former Member
Jun 28, 2015 at 02:54 AM

Join Function For Repeated Data

20 Views

I've got 2 groups and I need to concatenate values in a single text object, separated by paragraphs. I've got it working perfectly with one exception. It only shows unique values. So if my report has "Product 1, Product 2, Product 1, Product 3", my results only show the unique values "Product 1, Product 2, Product 3". I need all of them to appear in their original order. Can I do that in GF1? Below is what I have right now. Thanks!

@formula0 is in GH1

WhilePrntingRecords;

StringVar Array amtbrr := "";

StringVar amttin := "";

NumberVar amth := 0;

NumberVar amtk := 0;

@formula1 is in Details

WhilePrintingRecords;

StringVar Array amtbrr;

NumberVar amth;

If Not ({mainfield} in amtbrr) Then

(

amth := amth + 1;

Redim Preserve amtbrr [amth];

amtbrr [amth] := {mainfield};

);

amtbrr [amth]

@formula2 is in GF2

WhilePrintingRecords;

StringVar Array amtbrr;

StringVar amttin;

NumberVar amtk;

For amtk := 1 To Ubound(amtbrr) Do

amttin := amttin + amtbrr[amtk]

@formula3 is in GF1

WhilePrintingRecords;

StringVar Array amtbrr;

Join (amtbrr,ChrW(13));