Skip to Content

dont want increment unique values onto the next row of records.

Jan 11 at 11:00 PM


avatar image

The below formula works for me, but i got an issue where the following records it increment onto the next row.

for example...

row 1 - a,b,c

row 2 - (should only be a,c,d) but incremented --> a,b,c,a,c,d

row 3 - (should only be b,c,d) but incremented --> a,b,c,a,c,d,b,c,d

please advise, thank you!

1) Create a formula with this code and place it on the Details Section:

stringvar array plant;
redim preserve plant[GroupNumber];
plant[GroupNumber] := GroupName ({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]});

2) Create this formula to display a concatenated list of Plant Names and place this on the Report Footer:


stringvar array plant;

Join(plant, ", ");

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Abhilash Kumar
Jan 12 at 07:48 AM

Hi Sony,

Modify the formula on the Details to:

stringvar array plant;
numbervar inc;
if NOT({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]} IN plant) 
  inc := inc + 1;
  redim preserve plant[inc];
  plant[inc] := {0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]}


Show 3 Share
10 |10000 characters needed characters left characters exceeded

it's still doing, incrementing the unique values onto the next row of records for that column.

id | plant

id 1 x,y,z

id 2 x,y,z,a,b,c

id 3 x,y,z,a,b,c,1,2,3

id 4 x,y,z,a,b,c,1,2,3, Q,W,E

I have one group, which is group by the id.

I did tried by creating a second group 2, plant

and just messing around placing the display formula on either group 1 or 2 footer, but i cant seems to get it right.

I got a bunch of tables link, so i did just did the minimum of just two tables and it still increment.

I do have something that works for me, but just when i link the two tables only...when i have a bunch of tables like i would get a string error because there are too many duplicate values in that record. Is there anyway to remove the duplicate then the below formula should works for me.

"A string can be at most 65534 characters long. "

below formulas works for me, and it does not increment.

formula grp header

WhilePrintingRecords; StringVar ConcatenatedID; If Not InRepeatedGroupHeader Then ConcatenatedID := "";

detail formula

WhilePrintingRecords; StringVar ConcatenatedID := ConcatenatedID + plant;

display formula, group footer

WhilePrintingRecords; StringVar ConcatenatedID;

overall my goal is to have each id, which have multiple records of plant to be concatenate into one record.

your do work but it kept incrementing each unique plant values onto the next ID.

thank you for for reading this long post.

have a great weekend.


If you have a group, you need to reset the variables too.

Create a formula with this code and place on the Group Header for ID:

stringvar array plant := '';
numbervar inc := 0;

it works :) , thank you very much!

Sonny Nguyen Jan 12 at 03:04 PM

oh wow, didn't expect such a fast response to this since someone asked about this a couple years ago. Thanks!

I'll give a try. Thanks again

10 |10000 characters needed characters left characters exceeded