In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

IF Statement with Dates

Kristie_Pires
8 - Asteroid

Hello community,

 

I am looking to have a formula that says: "If the [Date] is equal to or greater than the 11th of the prior month, then "New Item". Today is 2022-09-28

 

DateComment 
2022-09-02New Item
2022-08-11New Item
2022-08-09"Leave blank"

 

The formula needs to be dynamic. Thank you :) 

5 REPLIES 5
binu_acs
21 - Polaris

@Kristie_Pires One way of doing this

 

binuacs_0-1664380076387.png

 

Emmanuel_G
13 - Pulsar

@Kristie_Pires 

 

Find in attachement the way of doing that.

 

Emmanuel_G_0-1664380197755.png

 

Kristie_Pires
8 - Asteroid

Thank you @binu_acs - it worked for my situation! 

 

I understood how the formula works except for the "7". I might have to use something similar in the future and I want to grasp it ;) 

binu_acs
21 - Polaris

@Kristie_Pires Let me explain the formula in detail

 

Left(toDate(DateTimeAdd(DateTimeToday(),-1,'Month')),7)+'-11', 'New Item','')

 

DateTimeAdd(DateTimeToday(),-1,'Month') - will return the previous month

ToDate() - function will convert the above DateTime value to just Date value (The time part will be ingnored)

Left() - function used to take from left to 7 character length. For example Left('2022-09-02',7) returns first 7 characters i.e 2022-09

 

 

 

Kristie_Pires
8 - Asteroid

Thank you both for helping me out! @binu_acs Thanks for explaining so that I can replicate the formula in the future 😊

Labels
Top Solution Authors