Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Connect two tables with 2 keys

Good day!

i have one table with fileds:

Sales:

Company

Product_Id

Second table

Product classifier:

Company

Product_Id

Product_name

In result it make syn key.

How to connect these two tables w/o syn key ?

Thx.

1 Solution

Accepted Solutions
sunny_talwar

You can try it this way, though there might be other ways. You need to give more details to give you a solution which will suit you the best.

QUALIFY *;

UNQUALIFY Join;

Sales:

LOAD Company,

          Product_Id,

          Company&Product_Id as Join

FROM yourSource1;

[Product Classifier]:

LOAD Company,

          Product_Id,

          Product_name,

          Company&Product_Id as Join

FROM yourSource2;


UNQUALIFY *;


HTH

Best,

Sunny

View solution in original post

6 Replies
sunny_talwar

You can try it this way, though there might be other ways. You need to give more details to give you a solution which will suit you the best.

QUALIFY *;

UNQUALIFY Join;

Sales:

LOAD Company,

          Product_Id,

          Company&Product_Id as Join

FROM yourSource1;

[Product Classifier]:

LOAD Company,

          Product_Id,

          Product_name,

          Company&Product_Id as Join

FROM yourSource2;


UNQUALIFY *;


HTH

Best,

Sunny

Not applicable
Author

I think Product_Name is high level data granularity dimension, Just use ApplyMap or Left join the table.

maxgro
MVP
MVP

1) there is no need to remove the syn key

2) but if you want to remove 

Sales:

load Company & '-' & Product_Id as Key inline [

Company, Product_Id

a,1

b,2

];

[Product classifier]:

load *, Company & '-' & Product_Id as Key inline [

Company, Product_Id, Product_name

a,1,product a

b,2, product b

c,1, product c

];

3) another remove syn key

Sales:

load AutoNumber(Company & '-' & Product_Id) as Key inline [

Company, Product_Id

a,1

b,2

];

[Product classifier]:

load *, AutoNumber(Company & '-' & Product_Id) as Key inline [

Company, Product_Id, Product_name

a,1,product a

b,2, product b

c,1, product c

];

Anonymous
Not applicable
Author

Many thanks)

Anonymous
Not applicable
Author

Thanks for advice!

Anonymous
Not applicable
Author

Thanks