Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Retrieve Previous FiscalMonth from the table that has data in YYYYMM

dcsramya
5 - Atom

I want to retrieve previous fiscal month from my data. 

 

I can using a filter tool to retrieve the need month, but  don't want to do it manually by changing the Fiscal month every time, instead want it automated so every time i run my workflow it needs to retrieve only previous month data. 

6 REPLIES 6
Luke_C
17 - Castor
17 - Castor

Hi @dcsramya 

 

You could use a filter like this. Essentially, subtract one month from today's date and format it to the YYYYMM format. 

tostring([FIS_MTH_ID]) = datetimeformat(datetimeadd(datetimetoday(),-1,'month'),'%Y%m')
 

image.png

dcsramya
5 - Atom

Thanks Luke 

 

My fiscal Period in the table is from Oct23 to Sep24 and  my previous period would be 202406 and not 202403. Since we are using Date time today it's fetching 202403 period.

Luke_C
17 - Castor
17 - Castor

Hi @dcsramya 

 

Got it. I'm not following how 202406 is the previous period. Previous compared to what? 

Bren_Spill
12 - Quasar
12 - Quasar

Hi @dcsramya - if you change -1 to +2 in @Luke_C's logic it will work.

 

@Luke_C - March is the 6th month of the 2024 fiscal year so we get 202406

dcsramya
5 - Atom

+2 worked

Bren_Spill
12 - Quasar
12 - Quasar

Just realized that won't when you're in October. For example instead of 202401, you would get 202312

Labels
Top Solution Authors