Discussion Board for collaboration on QlikView Scripting.
In Qlikview Script, is it possible to filter a SQL query based on the result of another query ?
if i load a Excel file with a column CustomerID (and 5 values), is it possible to use these values in the Where of the next SQL query of the Script ?
Go to Solution.
Yes that's possible. Something like:
Load concat(distinct CustomerID, ',') as IDlist
LET vIDlist = peek('IDlist');
Select * from MyTable
where CustomerID in ($(vIDlist));
If your customer id's are strings you need to change the concat to create single quotes:
concat(distinct chr(39) & CustomerID & chr(39), ',') as IDlist