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

Date function to say true or false

Inactive User
Not applicable

Hello,

Using formula i want to categorize as "YES" or "No" - for example if my date range is as of "01/01/2021" and look up with "01/01/2011", then it should perform greater or lesser function and provide my an output as "Y"or "N". Kindly advice.

 

Thanks,
Guru

6 REPLIES 6
Emil_Kos
17 - Castor
17 - Castor

Hi @Inactive User,

 

As a first step, you need to convert the data into the correct format. I have assumed that the first data is in the format below:

 

dd/mm/yyyy

 

Emil_Kos_0-1616513133819.png


If it isn't you will need to switch this formula:

DateTimeParse([Date],'%d/%m/%y')

 

to 

 

DateTimeParse([Date],'%m/%d/%y')

 

 

Inactive User
Not applicable

Hi @Emil_Kos 

 

I tried the logic , the output is not per expected. - can you verify below data and let me know how i can build a logic.

=IF(A17<B17,"N","Y") is the formula that used in excel. 

 

trandateAdj date Formula
1/29/19501/1/2011N
1/28/19501/1/2011N
1/28/19501/1/2011N
1/29/19501/1/2011N
1/29/19501/1/2011N
1/26/19501/1/2011N
3/30/20201/1/2011Y
4/3/20201/1/2011Y
4/3/20201/1/2011Y
4/8/20201/1/2011Y
4/8/20201/1/2011Y
5/5/20201/1/2011Y
5/5/20201/1/2011Y
5/6/20201/1/2011Y
5/7/20201/1/2011Y
5/7/20201/1/2011Y

 

Thanks,
Guru

tonypreece
10 - Fireball

With your dates in the right format the equivalent formula to your Excel is:

 

IIF([trandate]<[Adj date],"N","Y")

Inactive User
Not applicable

Hi @tonypreece 

 

Its shows all values as "Y"" by using this formula - IIF([trandate]<"2011-01-01","N","Y")

is there any way to constant 01/01/2011 and convert to date  ? please advice.

 

Thanks,

Guru  

Inactive User
Not applicable

I revisited the logic and its working fine. Thank so much ! 

Luke_C
17 - Castor

@Inactive User 

 

Both of the solutions above should work fine, see attached with the adj date referenced and with it hardcoded. 

 

Luke_C_0-1616521497300.png

 

Labels