Alteryx Designer Desktop Discussions

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

Dynamically change month

anandpandey19
5 - Atom

I've some months as my column name like below.

Now i'm reading first 4month at once. 

 

APRMAYJUNJULYAUG
145810
23679

 

Then i'm using dynamic rename to change these months like below

 

if contains([Current_field],'APR')

then replace ([Current_field],'APR','M1')

elseif  contains([Current_field],'MAY')

then replace ([Current_field],'MAY','M2')

elseif  contains([Current_field],'JUN')

then replace ([Current_field],'JUN','M3')

elseif  contains([Current_field],'JULY')

then replace ([Current_field],'JULY','M4')

endif

 

Now i want to change these months dynamically. Like next time it should start with MAY,JUNE,JULY and AUG

Is it possible to change the above calculation dynamically so that it keeps on taking 

2 REPLIES 2
Luke_C
17 - Castor

Hi @anandpandey19 

 

I would still use the dynamic rename, but use a positional rename and feed the M1, M2, M3, M4 values in via a text input. This way no matter what the first 4 columns are they get renamed accordingly. You can then go further and use a dynamic select to look for just these fields with the naming convention of M#

 

Luke_C_0-1631211111574.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @anandpandey19 

 

Here is my take on this just adding another option.

 

Workflow:

atcodedog05_0-1631211839916.png

 

I do agree with @Luke_C  approach. It is a good strategical approach.

 

Hope this helps : )

Labels