You are on page 1of 1

Enthusiastically created by:

LUIS FELIPE TENSINI


https://www.linkedin.com/in/tensini QLIK SENSE MERGE TIPS
Alternative perspective for better
understading of table joining

METHOD BEHIND THE SHOW PRACTICAL RESULT

LEFT JOIN A copy of the COLOR in B are moved to matching IDs in A Table A with some additional B data.
Table B is removed
F C F
R O R
U ID L U ID ID
I O I R
T R T LO ID
CO COLOR
FRUIT ID
COLOR
X
RIGHT JOIN A copy of the FRUIT in A are moved to matching IDs in B Table B with some additional A data.
F C C
Table A is removed
R O O
U ID L FR ID ID L
I O UI O
T R T R
FRUIT
ID
ID FRUIT

X COLOR

JOIN (outer) All data will be used from both Table A with ALL data from both.
Table B is removed
F C F C
R O R O
U
I
ID L
O
U
I
ID ID L
O
ID
T R T R
FRUIT COLOR
ID
COLOR
ID X
Table A will be sliced. A tiny version from
INNER JOIN Only the matches will be preserved
A will remain with some additional match
ID ID ID data from B. Table B is removed
FRUIT FRUIT COLOR
COLOR ID
COLOR
COLOR
ID

X
FRUIT

KEEP (alone) No effect! Result is the same. Need some prefix


(left, right or inner)
FRUIT COLOR
ID ID
FRUIT COLOR
ID ID

Keep only matched in A. Both tables remain standing


LEFT KEEP The rest in B will be removed B was sliced with no matches removed
ID
F ID F
R COLOR R FRUIT
U ID U ID ID ID
COLOR COLOR ID
I I COLOR
T ID T

Keep only matched in B. Both tables remain standing


RIGHT KEEP The rest in A will be removed A was sliced with no matches removed
ID
ID C C
FRUIT O O ID
ID L ID ID L ID
FRUIT O FRUIT O FRUIT COLOR
ID R R

INNER KEEP Keep only matched in both tables Both tables remain standing
with a sliced effect when not match
ID ID
FRUIT COLOR
ID COLOR ID ID COLOR
FRUIT FRUIT ID ID
ID ID ID ID FRUIT COLOR

You might also like