Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have the below code in script
LOAD
Key_EMS,
If(Scenario_Type='Consumption', date(Max(Movement_Date),'YYYY-MM')) AS Install_Date,
If(Scenario_Type='Defective', date(Max(Movement_Date),'YYYY-MM')) AS Removal_Date
resident Master_Final
group by Key_EMS;
Now i need to pass one more condition in If(Scenario_Type='Defective', date(Max(Movement_Date),'YYYY-MM')) as Removal_Date,
the condition what i need to pass is the below one
if(Removal_Date>Install_Date,'-',Removal_Date)
Can you please tell me how to achieve it.
Thanks,
Bharat
Bharat,
Try doing the following:
Table:
LOAD
Key_EMS,
If(Scenario_Type='Consumption', date(Max(Movement_Date),'YYYY-MM')) AS Install_Date,
If(Scenario_Type='Defective', date(Max(Movement_Date),'YYYY-MM')) AS Removal_Date
resident Master_Final
group by Key_EMS;
Left Join(Table)
LOAD
Key_EMS,
if(Removal_Date>Install_Date,'-',Removal_Date);
resident Table
Group BY Key_EMS;