Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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;
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
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