Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Please advise on UNION All in Select query,How to use:
Select
Details1 as Details,
a,
b,
c
From A
UNION ALL
Select
Details2 as Details,
a,
b,
c
From B;
Above statement is not working in load script.
I want to extract data with a select statement
for performance tuning.
Thanks for help
Nitha
Try putting the query in brackets (sql query)
Hi.
Do you have access to the database?
Try to run the statement in the SQL engine.
Remember that UNION will work if they are exactly the same fields in the same order.
Why don't you concat in Qlik as they advise you in the 1st comment? The result should be the same.
Can you try a loop?
Chris.
Hi,
try like with where clause
like this
Test:
SQL SELECT
Details1 as Details,
CONTROL_KEY ,
PKEY,
LKEY,
'1’ as Identifier
From RSID
Where 1=1
UNION ALL
SELECT
Details2 as Details,
CONTROL_KEY ,
PKEY,
LKEY,
'2' as Identifier
FROM RSIF
Where 1=1
UNION ALL
SELECT
Details3 as Details,
CONTROL_KEY ,
PKEY,
LKEY,
'3' as Identifier
FROM RSIG
Where 1=1;
Hi all,
Below script is working now
SELECT
Details1 as Details,
CONTROL_KEY ,
PKEY,
LKEY,
'1’ as Identifier
From RSID
UNION ALL
SELECT
Details2 as Details,
CONTROL_KEY ,
PKEY,
LKEY,
'2' as Identifier
FROM RSIF
UNION ALL
SELECT
Details3 as Details,
CONTROL_KEY ,
PKEY,
LKEY,,
'3' as Identifier
FROM RSIG
thanks for all help