Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I am looking to replace customer names with a certain value (i.e. 'X') based on the condition that the delivery for the customer was done earlier than 2 years ago. Therefore, I tried the following using an if statement but it doesn't seem to work properly:
Load
OrderID,
Customer_Name,
Delivery_Date,
if(Delivery_Date < 2017.01.01, Customer_Name='*', Customer_Name) as Customer_Name,
FROM QVD;
Also, is it possible to have the date as a dynamic field: based on the loading date, to replace everything that is older than 2 years?
Thank you.
So, you want to call your Customer X when Delivery_Date < 2017.01.01? try this
If(Delivery_Date < MakeDate(2017), 'X', Customer_Name) as Customer_Name_New
So, you want to call your Customer X when Delivery_Date < 2017.01.01? try this
If(Delivery_Date < MakeDate(2017), 'X', Customer_Name) as Customer_Name_New
For a dynamic solution... you can try this
If(Delivery_Date < YearStart(Today(), -1), 'X', Customer_Name) as Customer_Name_New