Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Date change based on an expired code.

Luk88kk
8 - Asteroid

Hello,

I would like to change the validity dates for the individual codes, but something is not working.
In the column "Number" I have the product codes. And for code 1234 I need to set new expiry dates - 01.07.2024 + UPD in a separate column "Status".

I have tried, but something is not working... I get a date of 1899-12-30...

Could you please help me with this.

 

How it is:

NumberDateStatus
123408.03.2023 
765809.02.2021 
796710.02.2021 
123411.06.2028 
981519.01.2021 
324515.10.2023 
123414.02.2021 
740225.06.2022 

 

How it should look:

NumberDateStatus
123401.07.2024UPD
765809.02.2021 
796710.02.2021 
123401.07.2024UPD
981519.01.2021 
324515.10.2023 
123401.07.2024UPD
740225.06.2022 
5 REPLIES 5
abe_ibanez
8 - Asteroid

Hello, 

Could you please post a screenshot or upload a copy of your current workflow? 

Thank you, 

Luk88kk
8 - Asteroid

Hi,

This is what I am trying to do.

abe_ibanez
8 - Asteroid

Thank you for posting the test workflow. 

The issue is with your formula tool. The tool is already replacing the value in "Date", so the formula does not need to have  [Date] = "01.07.2024" . It should just be IF [Number] = "1234" THEN "01.07.2024" ELSE [Date] ENDIF

Also, since the "Date" field is coming in as Data type: Date, you must use the default date format for Alteryx. Not sure if you have it set up where dates are formatted as dd.MM.yyyy. Normally, Alteryx formats dates as yyyy-MM-dd. 

So, for me to get it to work on my machine, I had to update the formula to: IF [Number] = "1234" THEN "2024-07-01" ELSE [Date] ENDIF. 

Hope this helps

abe_ibanez
8 - Asteroid

Thank you for posting the test workflow. 

 

The issue is with your formula tool. The tool is already replacing the value in "Date", so the formula does not need to have  [Date] = "01.07.2024" . It should just be IF [Number] = "1234" THEN "01.07.2024" ELSE [Date] ENDIF

Also, since the "Date" field is coming in as Data type: Date, you must use the default date format for Alteryx. Not sure if you have it set up where dates are formatted as dd.MM.yyyy. Normally, Alteryx formats dates as yyyy-MM-dd. 

So, for me to get it to work on my machine, I had to update the formula to: IF [Number] = "1234" THEN "2024-07-01" ELSE [Date] ENDIF. 

 

Hope this helps

Luk88kk
8 - Asteroid

Hi,

Thank you very much for the hint, it works great.

Have a nice day

Labels