Sort Month Name

data
(App Creator) #1

Hi!

I would like to find out if there’s any way to sort month name according to month order (Jan, Feb, Mar, Apr, …) instead of alphabetical order (Apr, Feb, Jan, Mar, …)?

Thank you!

(Levent Kulacoglu) #2

@App_Creator
May I ask where and how you are using that month names? And how you get them? With long date setting? Please elaborate.

(App Creator) #3

Thanks LeventK.

I got the month names using switch expression and the names became Text. Hence sorting according to alphabetical order.

SWITCH(MONTH([Date]), 1, “Jan”, 2, “Feb”, 3, “Mar”, 4, “Apr”, 5, “May”, 6, “Jun”, 7, “Jul”, 8, “Aug”, 9, “Sep”, 10, “Oct”, 11, “Nov”, “Dec”)

I am using these month names to group a set of entries and sort in desending order according to the month in a table view.

Thank you!

(Levent Kulacoglu) #4

@App_Creator
If it’s not a big deal for you, slightly change your SWITCH expression:

SWITCH(
MONTH([Date]),
1, “1-Jan”,
2, “2-Feb”,
3, “3-Mar”,
4, “4-Apr”,
5, “5-May”,
6, “6-Jun”,
7, “7-Jul”,
8, “8-Aug”,
9, “9-Sep”,
10, “10-Oct”,
11, “11-Nov”,
“12-Dec”
)

(App Creator) #5

That’s a great workaround! I will use that for the time being.

Thanks for your help, Leventk!

(Levent Kulacoglu) #6

You’re welcome @App_Creator, my pleasure. Great to be helped of.