Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Formula to always pull previous months data

IJH34
8 - Asteroid

I am looking for a formula that will return data from the previous month. I know I could use a simple filter tool and define my dates each month, but I would like to automate the process so it's always looking back at the previous months data. 

 

Example: Today is 6/6/2018, I would like all data from 5/1/2018-5/31/2018

 

In 2 months (8/6/2018), I would like data from 7/1/2018-7/31/2018

 

12 REPLIES 12
Markle
5 - Atom

This was very helpful. Thank you.

Owlpet
7 - Meteor

This was the solution I was looking for. However, was wondering if you have a code for in-db?

 

Thanks,

Peter

influentiale
6 - Meteoroid

Hi all, sorry a newbie but I am still returning the previous years using

ToNumber(DateTimeMonth(DateTimeToday()))-Tonumber(DateTimeMonth([date]))=1
Labels