Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

DateTimeTrim for Year

amandaj4123
7 - Meteor

I am trying to trim both my target date and today's date in order to compare <= by year.  My expression has become quite complicated at this point.  Is there an easier way?  If not, how do I achieve the output I'm looking for?

 

Example:  2016-01-20 (Target Date trimmed to year only) <= the current year (today's date trimmed to year only)

 

DateTimeTrim(DateTimeToday(),"month"&&"day")

 

Ready...Set...Go!

 

Thanks,

 

MandyJ

2 REPLIES 2
NicoleJohnson
ACE Emeritus
ACE Emeritus

DateTimeFormat formula should do the trick I believe (formats the field in question to show just the year):

 

DateTimeFormat([Field1],"%Y")<=DateTimeFormat(DateTimeToday(),"%Y")

 

NJ

amandaj4123
7 - Meteor

Thank you, Nicole!  Worked perfectly!  I was thinking it through entirely too hard.  

Labels