Forum Discussion
Sorting by Month Number
Hello,
I have a month and year column. I have created a conditional column which gives me the month number based on the month name. When I try to sort the data by the conditional column(Number), it gives me the month names as Jan Oct Nov Dec Feb Mar Apr May Jun Jul Aug Sept instead of the ascending month names. Please help. Thank you!
rarora20 make sure to change date type for your new column M# to whole number, it is string , you will not get correct sort because with string sort will go like this
1
10
11
12
2
3
4
5
6
7
8
9
and that is the reason you see Jan, Oct, Nov, Dec and so on..
13 Replies
- HasanResolver I
- select the data tab
- select the column: Month - makse sure that month is your defult
- "Sort By Column": Number"
- rarora20Regular Visitor
Tried it. Still giving me the same result.
- pxg08680Resolver III
Why doing such a long process. Instead try doing this.
Goto queryeditor, duplicate your month column and transform to MonthNumber and rename it any name and apply.
Now in modeling tab , use this new named column to sort the month column.
- pxg08680Resolver III
Do these steps
STEP1: Goto Home, EditQueries.
STEP2: Select the Month column that you have, right click and goto transform-->Month-->Month. This gives you month numbers.
STEP3: For same column right click and rename it to MONTHNUMBER.
STEP4: Close& Apply.
STEP5: Select the Month column from your data and got to modeling tab, sort column, select the newly created column, sort by MONTHNUMBER.
This should work.