Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

union in edit script

Hi All,

I'm having few csv files which I want to load in qlikview.

Is it possible to use union while loading csv files just like the way we use in sql queries

4 Replies
its_anandrjs

In place of the Union in qlikview you can go for Joins( Left,Right,Inner,Join) but if the column names are same then use Concatenate

Eg:-

Load Field1,Field2.... From Location

Concatenate

Load Field1,Field2.... From Location

Concatenate

Load Field1,Field2.... From Location

Note If column name are same then you just load the table qlikview concatenate the same field name tables.

Not applicable
Author

Just a clarification, the column names doesn't necessarily have to be the same to use concatenate.If they're not the same, the new columns will be added from the new table. This can be desired if you for example wish to merge two fact tables in the same model.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

And even if column names are different but you want them to be the same altogether, rename them as you load each successive .csv file.

Eg:

Load Field1,Field2.... From Location;

Concatenate

Load Piece1 AS Field1,Piece2 AS Field2.... From Location;

Concatenate

Load Fragment AS Field1, Date AS Field2.... From Location;

If all files have matching column names, and they have comparable filenames, use the simplest of all simple LOAD statements:

BigTable:

LOAD * FROM 'File-*.csv' (...);

Best,

Peter

its_anandrjs

Then Rename the fields as appropriate name to make same see the example below

Load Field1,Field2.... From Location

Concatenate

Load ColA as Field1, ColB as Field2.... From Location

Concatenate

Load FirstField as Field1,SecondField as Field2.... From Location