Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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
hello,
Please help me on this one as I am new on Qlik sense
Thank you