Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can some help me how to create a column DIFF_BUCKET referrenced based on DIFF column?
Second statement is not able to recognize the column DIFF created in the first statement.
Load ID,
Num(Floor(max(DATE1))-floor(min(DATE1))) as DIFF
Resident
TABLE_1
group by ID;
Load ID,
if(TABLE_1 <= 7, '1 Week','> 1 Week') as DIFF_BUCKET
Resident
TABLE_1;
Do this.
NoConcatenate
LOAD *,
If(DIFF <= 7, '1 Week','> 1 Week') as DIFF_BUCKET;
Load ID,
Num(Floor(max(DATE1))-floor(min(DATE1))) as DIFF
Resident
TABLE_1
group by ID;
It worked @BrunPierre , But will I not be able to refer a column created from one statement into another statement?