Sebastián
Sebastián

Reputation: 457

How to union two tables in Qlik Sense

I am trying to join/concatenate 2 tables, because it would be more comfortable to work because they have the "year-month" column in common. As you can see below:

picture of two tables in Qlik

I just have 1 table uploaded in Qlik Sense, the 1st one. And I'm trying to upload the 2nd one to just one table. There would be no point in having to move the "year-month" period in the columns 2 times.

I'm using only expressions and the tables have the relation year-month.

Any ideas?

Upvotes: 0

Views: 3869

Answers (1)

bananabrann
bananabrann

Reputation: 553

With Only Expressions

It might be tricky because what you're trying to do is typically handled prior to going to the front-end. If you're only trying to easily work with the data and selecting it, add the two separate tables as a master item (whatever chart you would like) then add that chart to your sheet. That will allow you to call one chart data set.

Ultimately, it doesn't solve your problem, but it's the best you're going to have if you want to use only expressions.


Combining the Tables

I think is your intent: use the data load script. The data load script is a simple SQL-like script that executes when the "load data" button is pressed. Here you can make columns, do math, join tables, split tables, do whatever you want.

Information about the script loader: https://help.qlik.com/en-US/sense/February2020/Subsystems/Hub/Content/Sense_Hub/Scripting/introduction-data-modeling.htm

It seems like you're trying to do is an outer join. Qlik data load script syntax reserved word for outer joins is simply join --It's an outer join by default.

At its core, you would simply have something like this:

LOAD * from table1.csv;
join LOAD a, d from table2.csv;

Upvotes: 0

Related Questions