Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Formula to pull previous month data

aparna0208
8 - Asteroid

Hi,

 

I am looking for a formula to get previous month data. I want to automate it so whenever I run the workflow it should only return previous month data. 

For example, if I run it today(9/22/2021), I want all the data from 8/1/2021-8/31/2021.

 

When I run it in October then I want data from 9/1/2021-9/30/2021. The number of days might be 30 or 31 depending on the month but I need all the data from previous month. Any help on this would be great!

 

Thank you in advance!

 

 

 

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @aparna0208 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1632326273752.png

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Hi @aparna0208 

 

Adding another method. Here is how you can do it.

Workflow:

atcodedog05_0-1632326565121.png

 

Hope this helps : )

 

aparna0208
8 - Asteroid

@atcodedog05 Thanks for your inputs. I tried both formulas on sample file that includes data for all months. I removed text input tool and instead substituted my excel file and then ran it. I just tried on August month data by running it as of today. I expected to get all data from 8/1-8/31 but both formulas didn't work. Also, that file includes all data starting from Jan and wasn't sure how to test that by going back in time like April and see if I get data for March.

atcodedog05
22 - Nova
22 - Nova

Hi @aparna0208 

 

Can you provide some sample input and expected output it will help us get a better understanding of the usecase.

cmosz
5 - Atom

I was looking for the same thing and this worked for me. I just had to change the [Date] field to be a separate [Effective Date] field that I needed to measure by. Thank you so much for this! : )

Labels