0

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

Jan 11 at 11:00 PM

45

Former Member

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

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

WhilePrintingRecords;
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:

WhilePrintingRecords;

stringvar array plant;

Join(plant, ", ");

Abhilash Kumar
Jan 12 at 07:48 AM
0

Hi Sony,

Modify the formula on the Details to:

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

-Abhilash

Show 3 Share
Former Member

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.

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:

```WhilePrintingRecords;
stringvar array plant := '';
numbervar inc := 0;```
Former Member

it works :) , thank you very much!

Former Member Jan 12 at 03:04 PM
0

I'll give a try. Thanks again

Share