Discussion Board for collaboration related to Creating Analytics for QlikView.
In a chart I have a calculated date dimension to get the year and the month, like this:
year & '-' & month
but I'm unable to sort this dates, any ideas?
thanks in advance!
use year * 100 + month, in this way you will have always numbers of 6 digits ex. 201401, 201402 ...
Sorting in this way is natural
Hope it helps
View solution in original post
Great! Worked like a charm, thanks Alessandro.
Try this in your sort expression
This was quite helpful for me.
month is a dual field. With a dual field you can show the string and sort by number.
If you are using monthname(Date) you will get Apr. 2019 for today, depending on your monthname settings and can sort by the numeric values.
If you want to show 2019 - 04 or 04 - 2019 you can load
dual(num(month(Date),'00' & '- ' & year (Date),year(Date)&num(month(Date),'00')) as Monthname
Show your field monthname and sort it by number if not by default.