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: 
Not applicable

problem with inner join

Hi!

I'm problem to do a inner join sintaxe.

Example:

Table1

Id (field)

name (field)

id     name

1     Mark

2     Jack

3     Luke

table2

Id (field)

type_device (field)

id     type_device

1     laptop

1     Pc

2     laptop

2     Iphone

2     Ipad

3     laptop

I need a table with:

id     name     type_device

1     Mark      laptop   

1     Mark      Pc

2     Jack     laptop   

2     Jack     Iphone

2     Jack     Ipad

3     Luke     laptop

Can someone help me?

7 Replies
oknotsen
Master III
Master III

What you are showing is just some data, without the actual script you are using.

Could you tell us what your problem is with inner join, preferably together with the script you are using?

May you live in interesting times!
PrashantSangle

Hi,

what is your issue??

did you get any error

syntax

Load Id,name from table1;

inner join

Load Id,type_device from table2;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Hello,

I'd use applymap function, to do it:

Table1:

Mapping Load id,

name

from source; //use the correct syntax depending on the source

Table2:

Load id,

applymap('Table2', id) as name,

type_device

from source;

sunny_talwar

I see no issues with a simple inner join here:

Table1:

LOAD * Inline [

id,    name

1,    Mark

2,    Jack

3,    Luke

];

Inner Join (Table1)

LOAD * Inline [

id,    type_device

1,    laptop

1,    Pc

2,    laptop

2,    Iphone

2,    Ipad

3,    laptop

];

Capture.PNG

oknotsen
Master III
Master III

Mapping is effectively a LEFT join, not an inner join.

It will also only return the first match if finds.

May you live in interesting times!
florentina_doga
Partner - Creator III
Partner - Creator III

try this

load * inline [id, name

1, Mark
2, Jack
3, Luke];

inner join

load * inline [id ,type_device

1, laptop
1, Pc
2, laptop
2, Iphone
2, Ipad
3, laptop];

the result is

   

idnametype_device
1Marklaptop
1MarkPc
2JackIpad
2JackIphone
2Jacklaptop
3Lukelaptop
muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

You can use Left Join,

Table1:

LOAD * Inline [

id,    name

1,    Mark

2,    Jack

3,    Luke

];

Left Join (Table1)

LOAD * Inline [

id,    type_device

1,    laptop

1,    Pc

2,    laptop

2,    Iphone

2,    Ipad

3,    laptop

];

Muthukumar Pandiyan