
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Concat() not working in the script
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
- Tags:
- new_to_qlikview


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try
LET itemString = Concat(peek(ITEM), ',');
BR
Ariel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Simply use '&' symbol for concat.
Karthik


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TEMP:
LOAD
ITEM
FROM TABLE;
LOAD
Concat(ITEM,',') as CONCAT;
RESIDENT TEMP;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
