If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
Hi,
I have a csv file containing a list of users.
I want to write a query such that it retrieves info only for the users in the csv.
I am trying to write something like:
connections:
SQL
SELECT * FROM (
SELECT
A,
B,
C
FROM
Table1,
Table2
WHERE
conditions..
) a
INNER JOIN (
SELECT
X,
Y
FROM
(upload contents of csv file)
) b
ON a.B = b.X;
How do I load the csv file in the script with label SQL?
OR, if I load the csv before the script as follows:
[file]:
LOAD
@1 as A,
@2 as B
FROM [file-path]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);
How do I use the columns A,B in the SQL script?
Thanks!
Something like this
[file]:
LOAD Concat(Chr(39) & B & Chr(39), ', ') as ConcatenatedB;
LOAD
@1 as A,
@2 as B
FROM [file-path]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);
Let vB = Peek('ConcatenatedB');
Now pass vB to your SQL...
May be store the content of field B in a variable and pass it on the SQL query via the variable
Field B has multiple rows. How do I handle that?
Something like this
[file]:
LOAD Concat(Chr(39) & B & Chr(39), ', ') as ConcatenatedB;
LOAD
@1 as A,
@2 as B
FROM [file-path]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);
Let vB = Peek('ConcatenatedB');
Now pass vB to your SQL...
Thank you so much!