Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sra1bandi
Contributor III
Contributor III

How to join data

Hi team 

i have 2 tables

 

Table 1:-

Code     Id

1             11AC

2             BR25

3              A810

 

Table2:-

Key            Id             Username

1               11AC          Raju

1               11AC         Vamsi

1               11AC           sai

 

I need to show the table like below

Required Output Table:-

Key     Id               Username

1               11AC          Raju

1               11AC         Vamsi

1               11AC           sai      

2             BR25             -

3              A810             -

 

When i am trying to do  left join i am getting result like all user names are assigning for each id but i need to show usernames only for ID= 11AC three usernames.

 

Regards,

Sravan.

Labels (1)
1 Reply
Marijn
Creator II
Creator II

Hi Sravan,

I'm not sure what you need exactly, but from the example this should do the trick.

main_table:
load *
resident table2;

outer join (main_table)
load
   Code as Key,
   Id
resident table1;

drop tables table2,table1;