Kategorien
Allgemeines Qlik Script

Datamodelling Qlik Concatenate, Power BI Combine, SQL Union

The last 6 months have been quiet full of many new things to learn – after working more than 10 years with qlik and SQL a new player named “Power BI” has been added to my skills. So getting more and more used to it, I feel, like I should give other qlik developers to understand faster how both world solve the same issues;)

The issue is simple and I use it very often for the appending two fact tables with each other. I keep this solutions “small” so I’m not showing you how to create a “manual” demo table…

Solution in SQL

Select
 eventname
 ,timestamp
FROM table1
UNION ALL
Select
 eventname
 ,timestamp
FROM table2

So this looks quiet simple 😉

Solution in Qlikscript

Table1:
LOAD
 eventname
 ,timestamp
FROM table1.csv;

Concatenate(Table1)
LOAD
 eventname
 ,timestamp
FROM table2.csv;

Looks simple too!;)

Solution in PowerQuery

...
 table1 = Source,
 table2 = SourceTwo,
 ResultTable = Table.Combine({table1,table2}),
...

This seems to be the shortest code sample, anyway you should not forgett, that the datasources are different, so for example 1, this can only be run on a SQL-Server. Qlik Script includes the datasource already in the script (csv-files) and for powerquery I ignored to add the connection to the datasources, which would have blown up the sample!

Schreibe einen Kommentar