We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to adjust a date based on logic

mlozovskaya
8 - Asteroid

Here are 2 examples I am looking for a help:

Option A: I want to add a new column C where I would see the same date plus 4 years 

Option B: I want to add a new column C where I would see a new date that come from column B plus 2 years and date & month set to January 1

See example below with input in column A&B and desired results in column C 

mlozovskaya_0-1629740327885.png

 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @mlozovskaya 

 

You can use this formula 

 

IF [Option]="A" 
THEN DateTimeAdd([Old Date],4,"years") 
ELSE 
DateTimeFormat(DateTimeAdd([Old Date],2,"years"),"%Y-01-01")
ENDIF

 

Workflow:

atcodedog05_0-1629740694718.png

 

Hope this helps : )

mlozovskaya
8 - Asteroid

That's exactly what I was looking for! Thanks so much!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @mlozovskaya 

If the response helps please don't forget to mark it as solution.

Cheers and have a nice day!

Labels
Top Solution Authors