Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Joining Tables

I have two tables, 'Post' and 'Metrics'

The fields that are in 'Post' are brandID, mediaID and linkID.

Metrics has many fields, but a common field is linkID. The tables are currently associated via that field, however I would like to introduce the field brandID into the table Metrics.

Is this possible via a join or another method or not possible at all?

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

Joins in qlik are very similar to sql with slightly different syntax. the join is done on the fields common between the tables

you can either use join see below 

https://help.qlik.com/en-US/sense/February2020/Subsystems/Hub/Content/Sense_Hub/Scripting/combine-ta...

or applymap (this works when 1 new column is needed) 

IamAlbinAntony
Creator
Creator

You can use apply map to get the brandID into the table Metrics using linkID.

And if you are loading this 2 table into qlik then concatenate both linkID&brandID as a key.

evansabres
Specialist
Specialist
Author

Thank you, can you please elaborate on how Apply Map work work in this scenario?

dplr-rn
Partner - Master III
Partner - Master III

rough script

brandmap:
mapping load
linkID, brandid
;

your sql for Post 


load column-a,

column-b,..
linkID,
 applymap('brandmap',linkID) as brandid
;
your sql for Metric