Alteryx Designer Desktop Discussions

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

Sorting Month

soulton
6 - Meteoroid

Hi! I want to find a cleaner way to sort my data by month (starting January) other than having a column I added labeled month_num (which works but is unappealing?  Would someone be able to assist?

3 REPLIES 3
Yoshiro_Fujimori
15 - Aurora

Hi @soulton ,

 

There are a bunch of date/time functions available.

https://help.alteryx.com/20223/designer/datetime-functions

So when you deal with dates, you may first consider converting it to Date type.

Once you get the Date type data, you can use it for sorting, and easily convert the format in your favorite style.

The workflow I posted to your previous question is one of the example. (attached again.)

 

Good luck.

caltang
17 - Castor
17 - Castor

Here's what I do with regards to sorting months:

 

Since there are always 12 months in a year - I know that is fixed. Just add a Text Input tool with the months sorted according to January, February, March, April, etc., and then use Record ID tool to rank them 1 to 12. 

 

Join the months with your data, and then Sort the RecordID ascending. Once that is done, use a Select tool to remove both the Joined month and the RecordID. 

 

Your final output will look clean! 

 

Hope this helps.

 

 

Best,

Cal

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
RobertOdera
13 - Pulsar

Hi, @soulton 

.

IMHO, your approach is solid - getting the DateTimeMonth (Month_Num).

Every other approach might be different, but the outcome will be the same - to achieve a sortable field by Integer, Double (because Text would put April before Jan, etc.)

 

Kindly consider using a Select Tool prior to output to only keep the fields that you need.

I hope you find this helpful - Cheers!

Labels