Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month vs. MonthName sorting issue

Hi All,

This appears to be a bug, but I thought I would do a sanity check first.  I created a small worksheet that just has data for 13 months, and a value to sum.  I created two charts to show the sums.  I put a sort value of =[Position Date] in the Expression for both.

If I use MonthName([Position Date]) as an expression for the dimension, it sorts correctly.  I use Month([Position Date]), it puts the data for May 2014 first in the chart, followed by the other months in correct order.

I have attached the application - if anyone can tell me why this is, and how to get the sort to work correctly, I would greatly appreciate it.

Thanks

12 Replies
Not applicable
Author

Yes u r ignoring the date but on the set statement which is on the expression level which is not going to affect the group by. Try selecting from June 2013 to May 2014 in your list box, it will do the sorting correctly . this is because u r now filtering it at the dimension level, so it now takes only from June 2013 to May 2014 when building the chart and as a result gives the correct result. If you dont select anything , even if u r ignoring the date in the set statement at the expression level, while building the chart it will be taken into account at the dimension level and henceforth it sorts from may. Another way to test what I said is to remove the date 2013 completely from the load statement and reload it and test it.

hic
Former Employee
Former Employee

It is indeed (sometimes) ignoring the sort condition. As it should.

[Position Date] is not a valid sort expression: The sort expression needs to be an aggregation, and since you don't have one, QlikVIew assumes Only([Position Date]) which returns NULL fairly often.

Consider the fact that one month (Month() or MonthName()) has several [Position Date]s associated - which should be used for sorting?

See more on It’s all Aggregations.

HIC

Not applicable
Author

Thanks, all.  On a deadline so I wasn't thinking clearly.