Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Assign SQL result to script variable

Hi,

I would like to assign the result of an SQL request in a script variable:

SET var='';

SELECT CONCAT(id,';') AS idlist

FROM table;

How do I assign idlist value (for example '1;5;7;10') to var?

I tried var=idlist but get an empty result.

Thanks

1 Reply
jason_michaelid
Honored Contributor II

Assign SQL result to script variable

LOAD

     idlist

;

SQL SELECT

     CONCAT(id,';')     AS     idlist

FROM table;

LET var = Peek('idlist');

This will place the last loaded value of idlist into the variable 'var'.

Hope this helps,

Jason

Community Browser