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

Column with previous period based on current date

Lu26
7 - Meteor

Hi all,

 

I have an almost finished workflow but need a column that shows the previous period.

 

So for example if today's the 7th of april the column should say "P06" (october is P01).

 

Does anyone know how to do that?

 

Thanks a lot!

7 REPLIES 7
AMansour
11 - Bolide

Hi @Lu26 

 

Does a correspondance table Like:

MonthPrevious periode 

OCT

P12
NOVP01
DECP02
... 
APRILP06

 

Where you will joint by 'MonthofDate" to bring the previous periode work in your case?

 

Don't hesitat to share an exepmle and we can work in it together.

 

Thanks

Amr

Lu26
7 - Meteor

Hi @AMansour,

 

this is the basic principle:

 

MonthPeriod
OCTP01
NOVP02
DECP03
JANP04
FEBP05
MARP06
APRP07
MAYP08
JUNP09
JULP10
AUGP11
SEPP12

 

 

And I want to create a column that gives me the previous period based on the current date. So if we're in april, I want him to write down P06 for march (reason for that is that my data is also based on the previous month).

 

Do you understand what I mean?

 

Thanks!

RolandSchubert
16 - Nebula
16 - Nebula

Hi @Lu26 ,

 

I think it could be done using a formula - see attached workflow. What do you think?

 

Best,

 

Roland

Lu26
7 - Meteor

Hi @RolandSchubert,

 

it worked perfectly fine for the "6" but unfortunately I also need the "P" in front of it (P01, P02,...P12).

 

Is it possible to include that?

 

Thanks a lot!

RolandSchubert
16 - Nebula
16 - Nebula

Of course, it's not a problem. I've modified the formula a bit, should return the expected result now.

AMansour
11 - Bolide

you can add this to @RolandSchubert solution 

 

AMansour_0-1586251785747.png

 

Lu26
7 - Meteor

Thanks for your help @RolandSchubert and @AMansour !

Labels