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
Hi Nitha,
Your statement should be
tablename:
LOAD *;
SQL 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;
Hi,
Try by adding schema name before table name.
Regards
ASHFAQ
Hi,
First load single table if it is loading single table, then include SQL keyword like below, hope this is the issue
Data:
SQL 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;
Regards,
Jagan.
Still it loads only first table and doesn't load rest of tables after UNION ALL
This line seems to be odd:
LKEY,,
Also, a strange quoting here:
'1’ as Identifier
Hi Ralf,
actual script its text not numbers.
I would suggest you to run script by adding one table at a time first to make sure you get data then later use union.
Regards
ASHFAQ
If its Query working on Oracle, Create a View with query and Call the query in Qlikview.
Or use UNION function instead of UNION ALL
What's about this wrong syntax (double comma):
LKEY,,