Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
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
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
Great! Worked like a charm, thanks Alessandro.
Try this in your sort expression
left(yearmonth,4)&Right(yearmonth,2)
Thank you!
This was quite helpful for me.
Hi,
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.
Regards