Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a small table with one column and about ten values that I want to concatenate into a single string in the script:
SQL SELECT DISTINCT item FROM table...;
LET itemString = Concat(item, ',');
However the resulting variable is empty (actually I do not even see it when looking at the variable editor).
When I define the variable in the variable editor (as = Concat(item, ',')), it works fine and I get a concatenated list of all values in the table.
Why is it not working in the script? Is there any other way to achieve this?
Thanks in advance.
Regards,
Robert
Hi
Try
LET itemString = Concat(peek(ITEM), ',');
BR
Ariel
Simply use '&' symbol for concat.
Karthik
Hi,
See below script it's very helpful for you
Ex:
Temp:
LOAD Concat(item,',') as ConcatItem;
LOAD * INLINE [
item
1
2
3
4
5
];
LET vitemString=Peek('ConcatItem',0,'Temp');
For your Script see below syntax:
Ex2:
Temp:
LOAD Concat(item,',') as item;
SQL SELECT DISTINCT item FROM table...;
LET itemString = Peek('item',0,'Temp');
TEMP:
LOAD
ITEM
FROM TABLE;
LOAD
Concat(ITEM,',') as CONCAT;
RESIDENT TEMP;
Hi,
Thanks, I found a similar solution in the mean time:
LOAD Concat(item, ',') AS ItemConcat;
SQL SELECT item from table...;
LET itemString = peek('ItemConcat');
Regards,
Robert