ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

IF Statement for Date Selection via Formula Tool

CDIns
アステロイド

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件の返信3
Deano478
クエーサー

@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
ポラリス

@CDIns 

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

image.png

CDIns
アステロイド

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!

ラベル
トップのソリューション投稿者