
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Union query in Qliksense script
Hello,
I need to write below union query in load script. But it is throwing error. Can you pls let me know what causing this issue?
LOAD Id,
a,
b;
SQL SELECT Id,
a,
b
FROM "TableA"
Union all
SQL SELECT id,
a,
b
FROM "TableB";


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In qllik sense or qlik view if two table have the same structure. It automatically concatenated(Union All) into one table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Qlik Sense script doesn't know a UNION operator. You can use CONCATENATE instead:
MyUnionTable:
SQL SELECT Id,
a,
b
FROM "TableA"
CONCATENATE (MyUnionTable)
SQL SELECT id,
a,
b
FROM "TableB";
talk is cheap, supply exceeds demand

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Manoj,
Union All is an old method in Qlik scripting so you can use CONCATENATE keyword instead of that.
SQL unions require that the same fields, with the same data types exist in each SELECT in the same order.
QV concatenates do not require any of these, but 'missing' fields will get null values.
Regards,
Quddus Mohiuddin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Gysbert,
But SQL query with union works in Qlikview. It takes it as entire query. So this doesn't work only in Qliksense?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Every platform will have independent functionality, A concatenation is in principle the same as the SQL UNION statement.
Refer this:
