Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula for dynamic dates

HannahSwain7
7 - Meteor

Hi! 

 

I have a data set with a number of columns containing various dates. I want to create a formula which nulls any dates with are more than 3 years old. The workflow will run regularly so the formula needs to be dynamic. How would I do this please?

 

Many thanks,

Hannah

2 REPLIES 2
aatalai
15 - Aurora

@HannahSwain7  try this conditional formula

 

If  [datefield] < datetimeadd(datetimenow(),-3,"year") then null() else [datefield] endif

Deano478
12 - Quasar

Hey @HannahSwain7 can you throw some sample dates in here so we can test on them?

Labels
Top Solution Authors