Discussion Board for collaboration regarding Qlik DataMarket.
I have YearMonth Column in my datamodel which is like this ...
but when I fetched this column against any dimension in pivot it can not come in same order.It is coming like this
What would be the right way to sort this column in same fin order.
Its sorting for the text, not a numerical representation.
I would advise you to create a date with the function date#([Field],'format') so that it creates the dual for the date your using.
In your case, the sort is correct, since 'Apr' < 'Aug' and so on.
After that, the sorting issue will be addressed since it will be using the numeric representation of the date to sort.
Unable to sort.
try sort by expression Monthstart(Date)
Use the below expression in sort tab of pivot table.
You can even sort by adding below expression to sort by expression:
Pick(Match(YearMonth,'2016-Apr','2016-May','2016-Jun','2016-July'),'1','2','3','4')...............So on for all the months
And Make it by Ascending.
You can even sort it by YearMonth directly in sort by expression
Change your field in your data model to be a dual field. Then you can set it to sort numerically.
dual(YearMonth,left(YearMonth,4) & num(month(date#(right(YearMonth,3),'MMM')))) as YearMonthNew
I'm using MonthName(today()) at backend and calculate dimension