Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Is there a formula to check a date is after a specific date?

donnell
6 - Meteoroid

Hi, I'm currently trying to create a formula to look at a persons start date in the company and check whether that date is after 1 June. However, I want to be able to run this every year so need to create a dynamic date for the year part of the formula but static part of the date for the 1 June part. Is there an easy way to do this? Thanks!

9 REPLIES 9
JosephSerpis
17 - Castor
17 - Castor

Hi @donnell I mocked up an approach to do this which use the function DateTimeToday() and extracts only the year part and keeps the rest of the date as June 1st. Let me know what you think?

 

Dates_10032021.JPG

Emil_Kos
17 - Castor
17 - Castor

Hi @donnell,

 

I have created a workflow for you:

Emil_Kos_0-1615409263350.png

 

Output:

Emil_Kos_1-1615409180823.png

 

donnell
6 - Meteoroid

Worked brilliantly - thank you both!

donnell
6 - Meteoroid

Any ideas on how you would amend the formula say if the date was 1 February and we wanted to look back to the previous June? The Datetime today won't work for me as it is not the current year

Emil_Kos
17 - Castor
17 - Castor

Hi @donnell,

 

Can you give me more details about when it should be done? 

So if this was 1992 1st of February I need to check if this is after 1st of June 1991? 


Please give a little bit more details because each date that I can imagine is after previous year 1st of June 😛 

donnell
6 - Meteoroid

@Emil_Kos  yes of course! so what I am trying to do is actually to look back to the previous 1 June!

 

So if I were to run the workflow today, the previous 1 June is actually in 2020. However, if I were running the workflow later this year (say in August for example) the previous 1 June is actually in 2021 then!

 

I want it check whether a date is after the previous 1 June based on the date of running the workflow if that makes sense?

Emil_Kos
17 - Castor
17 - Castor

Hi @donnell,

 

The date is always after the previous June 😄 I don't get it but I will create a workflow for you that shows what is the previous June date. and you should be able to work with that. 

Emil_Kos
17 - Castor
17 - Castor

Hi @donnell,

 

1 Jun shows the nearest previous June date.

 

Hope this is helpful:

 

Emil_Kos_0-1615412427547.png

 

donnell
6 - Meteoroid

@Emil_Kos sorry I get the confusion! Its not looking at the date now - it is looking at an employee start date from a separate field in the workflow!! I'll try the IIF - thanks!

Labels
Top Solution Authors