on 2013 May 15 12:46 PM
Hi,
i have a requirement, i have to display list of plant names field where plant number is the prompt in BEx query , i wrote the below code to get the plant name list from the field, but plant name field contain repetitive values and those values are not unique because of that i am getting first plant name multiple time instead of all plant names. please help me in finding the solution.
Formula Code:
Stringvar s:="";
Numbervar i:=3;
For i:=1 to distinctcount({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]})
do s:=s +" "+totext(join(makearray(GroupName ({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]})),','));
s [1 to length(s)];
Thanks,
Ambreen
Request clarification before answering.
Hi Ambreen,
Why is i:=3? Where have you placed the formula? If you place it in Report Footer, it should work.
Alternatively, Abhilash's formula will be helpful since the 'array' size is directly based on GroupNumber.
-Prathamesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi abhilash,
i have only group in my report that is plant group. and the formula which i am using is
Stringvar s:="";
Numbervar i:=1;
For i:=1 to distinctcount({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]})
do s:=s +" "+totext(join(makearray(GroupName ({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]}))));
s [1 to length(s)];
thanks,
ambreen
Let's try this again. Can you try replacing the 1st formula with this code:
WhilePrintingRecords;
stringvar array plant;
numbervar x;
if NOT({0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]} IN plant) then
(
x := x + 1;
redim preserve plant[x];
plant[x] := {0PUR_C01_YQRY_0PUR_C01_003.[0PLANT]};
);
"" //Don't miss these quotes at the end of the formula - we need it.
Then use the 2nd formula in the Report Footer. This in no way can contain duplicates. The other formula should also not contain duplicates. Anyway, please try this and let us know.
-Abhilash
User | Count |
---|---|
73 | |
21 | |
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.