Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
RajuNatesan
Contributor II
Contributor II

New Column creation using Data load editor

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;

Labels (1)
2 Replies
BrunPierre
Partner - Master
Partner - Master

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;

RajuNatesan
Contributor II
Contributor II
Author

It worked @BrunPierre , But will I not be able to refer a column created from one statement into another statement?