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: 
kristeljoymalapitan

How to use Left Join functions in Qlik Sense?

Please see below sample query , I already know on how to use CASE WHEN statement, I just added if incase.

 

SELECT  case when a.colA >b.colA THEN 'true' ELSE 'false',

a.colB

FROM TBL1  a

LEFT JOIN  (SELECT colA,colB,colC) FROM TBL2 b

ON a.colA = b.colA;

Note: TBL1 is my main table, I will use colA in TBL2 to achieve above output

 

Hope to hear from you the soonest.

 

Thank you

Labels (1)
1 Solution

Accepted Solutions
kristeljoymalapitan
Author

Hi I'am trying below query..

OCT_TBL:

LOAD

OCT_TBL.COL A,

OCT_TBL.COLB

FROM OCT_TBL

LEFT JOIN (OCT_TBL)

LOAD

SEP_TBL.COL A,

SEP_TBL.COL B,

IF(SEP_TBL.COL A > OCT_TBL.COL A,'OUTPUT_1',

IF(SEP_TBL.COL A < OCT_TBL.COL A,'OUTPUT_2',

IF(SEP_TBL.COL A='NULL','OUTPUT_3',OUTPUT_4'))) AS COL C

FROM SEP_TBL

 

I'am using/comparing column A of OCT_TBL and SEP_TBL tables

My main table should be OCT_TBL table, however OCT_TBL.COL A is not found. ( inside IF statement which error encountered)

 

May I know the correct syntax of above mentioned scenario.

 

Thank  you

View solution in original post

3 Replies
arvind_patil
Partner - Specialist III
Partner - Specialist III

hi,

Please Try As below:

TBL1  :

Load

A as colA

B

FROM TBL1  ;

Left Join(TBL1 )

Load

colA,

colB,

colC

FROM TBL2 ;

Thanks & Regards,

Arvind Patil

kristeljoymalapitan
Author

Hi I'am trying below query..

OCT_TBL:

LOAD

OCT_TBL.COL A,

OCT_TBL.COLB

FROM OCT_TBL

LEFT JOIN (OCT_TBL)

LOAD

SEP_TBL.COL A,

SEP_TBL.COL B,

IF(SEP_TBL.COL A > OCT_TBL.COL A,'OUTPUT_1',

IF(SEP_TBL.COL A < OCT_TBL.COL A,'OUTPUT_2',

IF(SEP_TBL.COL A='NULL','OUTPUT_3',OUTPUT_4'))) AS COL C

FROM SEP_TBL

 

I'am using/comparing column A of OCT_TBL and SEP_TBL tables

My main table should be OCT_TBL table, however OCT_TBL.COL A is not found. ( inside IF statement which error encountered)

 

May I know the correct syntax of above mentioned scenario.

 

Thank  you

kristeljoymalapitan
Author

hello,

Please help me on this  one as I am new on Qlik sense

Thank you