Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
entsh
Contributor II
Contributor II

multiple join

hello

would you please help me:

table1

date num
12/12/2022 9
12/13/2022 20
12/14/2022 21
12/15/2022 56
12/16/2022 20
12/17/2022 10
12/18/2022 11

 

table2:

date1 date2 date3
12/15/2022 12/13/2022 12/12/2022
12/16/2022 12/14/2022 12/13/2022
12/17/2022 12/15/2022 12/16/2022
12/18/2022 12/18/2022 12/17/2022

 

I want  to compare table 1 and table 2 (column date with columns date1,date2,date3) and add & fill num1,num2,num3( red columns)

result:

date1 num1 date2 num2 date3 num3
12/15/2022 56 12/13/2022 20 12/12/2022 9
12/16/2022 20 12/14/2022 21 12/13/2022 20
12/17/2022 10 12/15/2022 56 12/16/2022 20
12/18/2022 11 12/18/2022 11 12/17/2022 10

 

what should i write in edit script?

thanks

Labels (2)
1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like below

MapNum:

Mapping Load date, num from table1;

Load date1, applymap('MapNum', date1, 0) as num1,

date2, applymap('MapNum', date2, 0) as num2,

date3, applymap('MapNum', date3, 0) as num3

from table2;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
stevejoyce
Specialist II
Specialist II

assuming table 1 and table 2 loaded already.

 

left join (table2)

load 

  date as date1

  , num as num1

resident table1;

 

left join (table2)

load 

  date as date2

  , num as num2

resident table table1;

 

left join (table2)

load 

  date as date3

  , num as num3

resident table1;

 

drop table table1;

MayilVahanan

Hi

Try like below

MapNum:

Mapping Load date, num from table1;

Load date1, applymap('MapNum', date1, 0) as num1,

date2, applymap('MapNum', date2, 0) as num2,

date3, applymap('MapNum', date3, 0) as num3

from table2;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.