Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bguiliano
Contributor II
Contributor II

New to qlik sense - Help with synthetic keys

Hi all, 

Working on my second qlik sense app....

I have data from two sources and two fields i need to have in common (CARRIER and TIN)

Below are parts of each select statement for those two fields

Not sure why i am getting synthetic keys for the carrier and tin fields.

 

thanks

 

From Table 1:

 

SUBSTR(XXXXXX,1,9) AS TIN,

XXXX AS CARRIER

 

From Table 2:

 

CARRIER = case when
CARRIER = 'XX' then 'XXXXX'
when CARRIER = 'XX' then 'XXXXX'
when CARRIER = 'XX' then 'XXXXX'
when CARRIER = 'XX' then 'XXXXX'
when CARRIER = 'XX' then 'XXXXX'
when CARRIER = 'XX' then 'XXXXX'
end,

TIN

Labels (2)
1 Reply
gp_oconnor
Partner - Contributor III
Partner - Contributor III

In a scenario where one has a master data table and a transaction table, you can do the following to get the tables to associate on a concatenated key, with the components of the concatenated field only being stored in the data model on the master data table.

MasterDataTable:

load *, [FieldA] & '-' & [FieldB] As [KeyField];

sql select FieldA, FieldB

from Table1;

 

'TransactionTable':

load TxnFieldC, TxnFieldD, [FieldA] & '-' & [FieldB] As [KeyField];

sql select FieldA, FieldB, TxnFieldC, TxnFieldD

from Table2;