Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkumargowda
Creator
Creator

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";

5 Replies
ChennaiahNallani
Creator III
Creator III

In qllik sense or qlik view if two table have the same structure. It automatically concatenated(Union All) into one table.

Gysbert_Wassenaar

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
quddus_mohiuddi
Partner - Contributor III
Partner - Contributor III

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

manojkumargowda
Creator
Creator
Author

Hi Gysbert,

But SQL query with union works in Qlikview. It takes it as entire query. So this doesn't work only in Qliksense?

balabhaskarqlik

Every platform will have independent functionality, A concatenation is in principle the same as the SQL UNION statement.

Refer this:

https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/ScriptPrefixes/concatena...