Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I need help on below visualization. The graph is not displayed according to month. It should be January, Feb, Mar so on.
In below screenshot, if I already selected a filter in 'Year' the months are in chronological order. But then If I selected another filter in Month then the graph is not in chronological order. I want it to show in chronological order regardless if I filter it. What expression do I need to do?
Ok, in my end it worked but I think my data sample was too simple. Could you, please, try this one?
pick(match(only({1} STC_Month),' January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'), '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12')
It is a bit more complex, but the idea is the same. To hard code a value for each month in order to use it to sort. In this case I add the "only" to be able to make a set analysis to ignore the Month selection when doing the pick and match functions.
I hope this helps.
Kind Regards
Daniel
I think you can just use the Sort Numerically instead of Sort by Expression. If not try the following formula:
pick(STC_Month, 'January', 'February', 'March', 'April', 'May',' June',' July', 'August', 'September', 'October', 'November', 'December')
The pick function checks the value inside STC_Month and assigns a number according to the position of the hardcoded value. In this way you are always assigning 1 to January, 2 to February... etc; and the dimension is then sorted following these numbers.
Kind Regards
Daniel
Try like this , create a inline load with the dimension name and assign the order ..then use this sort order in the expression .
Load * inline
[
dimension_Name,Sort_Order
Jan,1
Feb,2
Mar,3
Apr,4
May,5
Jun,6
Jul,7
Aug,8
Sep,9
Oct,10
Nov,11
Dec,12
];
Hello,
I tried using the expression but still, it doesn't pick the January month as the first in order. Also tried rearranging the sorting but it still not in chronological order.
Ok, in my end it worked but I think my data sample was too simple. Could you, please, try this one?
pick(match(only({1} STC_Month),' January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'), '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12')
It is a bit more complex, but the idea is the same. To hard code a value for each month in order to use it to sort. In this case I add the "only" to be able to make a set analysis to ignore the Month selection when doing the pick and match functions.
I hope this helps.
Kind Regards
Daniel
Hi Daniel,
These works!! Thank you so much for your help.