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

Alteryx Designer Desktop Discussions

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

Based on Current Date get all previous months in current and previous year

sneha_bhiwagade1
8 - Asteroid

Hi,

 

Based on Date="2019-12-20" I was able to get all the months of the current year using generate rows formula 

[ListOfMonths]>= DateTimeAdd([Date],-DateTimeMonth([Date]),"months")

 

But now when I am selecting Date as "2020-01-20".
Not able to get the list of all the months from previous year.

 

 

Thank You!

3 REPLIES 3
DavidP
17 - Castor
17 - Castor

Does this work for you?

 

DavidP_0-1582540694132.png

 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @sneha_bhiwagade1 ,

 

if I got the right understanding, you want all previous months for previous and current year  for 2019-12-20 this list would include Jan 2018 - Nov 2019, for 2020-01-20 it would be Jan-2019 - Dec 2019. I've created a sample workflow- what do you think?

 

 

Best,

 

Roland

sneha_bhiwagade1
8 - Asteroid

It's working perfectly fine.

 

Many Thanks.

Labels