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

Dynamic rename ordered by Month and year

Brinker
8 - Asteroid

My workflow takes a date field, strips it down to Mon - yyyy then does a cross tab to make the months columns. Here lays the issue; the cross tab orders the columns in alphabetical order but it needs to be ordered by date, e.g. Jan-2022 Apr-2022 NOT Apr-2022 Jan-2022.

 

 

6 REPLIES 6
Luke_C
17 - Castor

Hi @Brinker 

 

Maybe something like this? I updated your formula tool to output the month number instead, then handled updating to the month name in the dynamic rename.

 

Luke_C_0-1650987018210.png

 

 

ChrisTX
15 - Aurora

Check out this post, which uses RecordId

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Breakdown-one-column-into-lagged-colum...

danilang
  This workflow gives you close to what you're looking for.

  The record Id in the top branch will be used to get around the fact the final Cross tab tool will arrange output rows alphabetically

 

 

And this one:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Count-the-non-null-values-across-multi...

solution attached to post above includes a dynamic re-name of columns, based on the original column order

 

and this one:

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/How-to-order-columns-by-any-given-line...

 

 

This article might be useful:

Can the real [Field Name] please stand up...

https://community.alteryx.com/t5/Engine-Works/Can-the-real-Field-Name-please-stand-up/ba-p/611088

 

 

And finally, look at the attached Word document which contains an embedded workflow.  I started with a post from the Austin user group and created the workflow inside the Word document.

 

Chris

 

JagdeeshN
12 - Quasar
12 - Quasar

@Brinker 

 

The below formula in the dynamic input tool should do the trick for you:-

 

REPLACE([_CurrentField_],[_CurrentField_],Datetimeformat(replace([_CurrentField_],'_','-'), '%B-%Y'))

 

This basically replaces the _ first and then parses the date string.

 

Please find attached a sample. Hope this helps.

 

Best,

Jagdeesh

 

 

binuacs
20 - Arcturus

@Brinker another way of dong this

 

binuacs_0-1650988713324.png

 

 

Brinker
8 - Asteroid

@ChrisTX There were so many of these all just slightly different from mine and I couldn't manage to tweak it. Thank you very much, hope this posts and your links helps others.

Brinker
8 - Asteroid

@binuacsThank you so much! Works like a charm

Labels