Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Analog Union all in Qlikview

Hi guys,

I have query from SQL, where use UNION ALL command. If somebody knows analog Union all in Qlikview.

Thanks,

7 Replies
alexandros17
Partner - Champion III

I know the concatenate ... try to see in help.

MK_QSL
MVP

CONCATENATE

jonathandienst
Partner - Champion III

Hi

In Qlikview, you can concatenate tables to achieve the same effect as Union. In fact, QV will automatically concatenates tables if they have the same fields. You can prevent the auto-concatenation using NoConcatenate

Concatenate(Table1)

LOAD *

From Table2;

You can also pass a UNION through to SQL (to be executed by your DBMS, such as SQL Server) using the SQL keyword.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Luis_Cortizo
Employee

Try Concatenate:


Concatenate

If two tables that are to be concatenated have different sets of Fields, Concatenation of two tables can still be forced with the Concatenate prefix. This statement forces concatenation with an existing named table or the latest previously created Logical Table. A concatenation is in principle the same as the SQL UNION statement, but with two differences: first that Concatenate prefix can be used no matter if the tables have identical field names or not; and secondly that no removal of identical records are made.

It's basically the same thing.

rbecher
MVP

That SQL query with UNION ALL should also work in Qlikview..

If you try to implement a LOAD from non SQL source you can use CONCATENATE. But you have to consider that (instead of SQL UNION) the resulting table will have all fields from both source tables. So, it could be better to use a field list with same field names from both sources in the two loads and not to use LOAD * FROM..

- Ralf

Astrato.io Head of R&D
IAMDV
Luminary Alumni

Union ALL:

LOAD Field1, Field2 from Table1

Concatenate(Table1)

LOAD Field1, Field2from Table2


Union:

LOAD DISTINCT Field1, Field2 from Table1

Concatenate(Table1)

LOAD DISTINCT Field1, Field2from Table2

Cheers,

DV

rbecher
MVP

..btw. the DISTINCT in first LOAD of your Union example will have effect for the whole resulting table.

Astrato.io Head of R&D