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 for Date Selection via Formula Tool

CDIns
8 - Asteroid

Trying to set up an automated work flow that is pulling out data from a larger data set based on the date field. This exercise is completed in the first week of the month for the previous month. For example, In May I'll be looking for just April data. To make things even more complicated, my data set is year to date. 

 

Is there an IF Statement I can apply here, something like:

 

IF [ReportingDate]> Current Month end date minus 2 months AND <= Current Month end 

 

For May something like:

 

IF [ReportingDate]>03/31/25 and <=04/30/25  

 

I am trying to avoid having to update my data parameters each month. 

 

Any ideas? 

 

Thanks in advance, Community!

3 REPLIES 3
Deano478
12 - Quasar

@CDIns the best approach would be to first get the previous month start and previous month end and then create a dynamic filter from there 

binu_acs
21 - Polaris

@CDIns 

[ReportingDate] > toDate(DateTimeTrim(DateTimeAdd(DateTimeToday(),-1,'month'),'lastofmonth'))
AND
[ReportingDate] <= toDate(DateTimeLastOfMonth())

image.png

CDIns
8 - Asteroid

Hi Binuacs, thank you for the reply. Quick follow up, since we are currently in April, how would I get it to to be <02/28/25 and <= 03/31/25? 

 

Please disregard- I was able to back into it using the formulas you provided above

 

Thanks!

Labels
Top Solution Authors