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

Join syntax

I have two tables. I want to create an if statement from Table B. Something like below but I cannot get the syntax correct.

TableA                TableB

CreateDate          AlertDate

ID                         ID

FINAL:
JOIN([TableA])
LOAD *, IF( CreateDate - AlertDate>= 180, 'N', 'Y') AS Indicator
RESIDENT TableB;

Final resutls I would like to see the two tables joined.

TableA (No changes)    Table B

                                      AlertDate

                                       ID

                                      Indicator

4 Replies
its_anandrjs
Champion III
Champion III

You have to try this way

TableA:

Load

CreateDate        

ID 

From TableA;

Join(TableA)

TableB

Load

AlertDate

ID  

FRom TableB;                  

Noconcatenate

FINAL:
LOAD *, IF( Interval( CreateDate - AlertDate, 'D' ) >= 180, 'N', 'Y') AS Indicator
RESIDENT TableA;

Drop Table TableA;



Regards

Anand

rupamjyotidas
Specialist
Specialist

Maybe this

FINAL:
LOAD *, IF( Interval( CreateDate - AlertDate, 'D' ) >= 180, 'N', 'Y') AS Indicator

;

Load

CreateDate        

ID 

From TableA;

Join

TableB

Load

AlertDate

ID  

FRom TableB;                  

antoniotiman
Master III
Master III

Maybe this

TableA: 
Load  * inline [
CreateDate,ID 
10/11/2016,A
15/10/2016,B
]
;

TableB: 
Load  *,
IF(Lookup('CreateDate','ID',ID,'TableA') - AlertDate >= 180, 'N', 'Y') AS Indicator
inline [
AlertDate,ID
10/10/2016,A
01/01/2016,B
]
;

Regards,

Antonio

MarcoWedel

after loading tables A and B:

Join (TableB)

LOAD * Resident TableA;

Join (TableB)

LOAD *, If(CreateDate-AlertDate>=180, 'N', 'Y') as Indicator Resident TableB;

Drop Field CreateDate From TableB;

hope this helps

regards

Marco