Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tdiwanji
Contributor
Contributor

Reg: How to create joins & populate the field

If I have two Tables, EMP and SALES and want to populate certain values. Can someone guide me how can I write joins and where ? How can I populate the Dimension value by creating a join of two or more tables ?

For eg.

EMP

EMPNONAME
1A
2B

SALES

EMPNOCITYSALES
1X100
2Y200

TO BE

RESULT


EMPNOCITYSALESNAME
1X100A
2Y200B

5 Replies
ogautier62
Specialist II
Specialist II

Hi,

you can do it in script :

if you have loaded emp and sales

add in script :

inner join (emp) load empno,city, sales resident sales;

you can add : drop table sales

all fields will be in emp

regards

tdiwanji
Contributor
Contributor
Author

Thanks.. But this will create denormalized table isn't it ? Also, I will have to load the table everytime, I want to add any calculated column in any one of the tables.

Is my understanding correct ?

pooja_prabhu_n
Creator III
Creator III

Hi,

Emp:

load * from Emp;

inner join(Emp)

load * from sales;

Join will keep the only first table along with all the columns from second table.

Yes, it will be denormalized table.

For any calculated columns from , you can just add that calculated column in the table.

Hope this helps

Thanks,

Pooja

tdiwanji
Contributor
Contributor
Author

Thanks all for the help. it worked.

mdmukramali
Specialist III
Specialist III

Hi,

Well if you are looking to generate the resulted table basically you don't need to join those two tables.

Both table, if the EMPNO is common key then automatically both tables will be connected and you can get the result.

if you have only a few records in those tables it's ok to join two tables but if you have many records then Join will take time to load the data.

And one more thing if you want to load only those records of employees from the SALES table who are available in EMP table then you can you WHERE EXIST Condition.

Like :

Emp:

load * from Emp;

Sales:

load * from sales

where exist(EMPNO);

Thanks,

Mohammed Mukram