Discussion board where members can get started with Qlik Sense.
I have created a bar chart in Qlik Sense with Year Month combination as Dimension (like Jan-2016, Feb-2016,......Nov-2020,Dec-2020...etc) and Expression is sum of sales for that combination.
The bar shows like this...
I want to sort the bars based on Month and Year like Jan-2016, Feb-2016, March,2016..etc.
Please help me in this regard.
Solved! Go to Solution.
It looks like dimension you have created is a text only field. So i guess your MonthYear field is not created from date and it comes straight as it is in your source.
Normally date related dimensions are having dual value which is number and text behind it so you can then decide to sort it by text or by number.
I suggest to get it converted to dual and then sort numerically as Ugonna sugested.
To convert to dual go to script and do following thing:
If your source is already sorted the way you want it just load your field YearMonth with this formula - Convert your MonthYear to dual (text and autonumber):
Dual(MonthYear , autonumber(MonthYear,'MonthYear') as MonthYear
There are other ways of getting the same thing working. It would be handy if you could provide qvf file and source for it so we could have a look and test
How are you loading the month field? Are you using Date() or MonthName() in script? If it is string then load this field in script like below
Date(MonthStart(DateFieldName), 'MMM-YYYY') AS MonthYear
Now use MonthYear field as dimension, if it is not sorted automatically then in Sort tab select Sort Numerically option.
Hope this helps you.
It depends on your script, if u create YearMonth as text i mean monthname or sth like that QS ll order it by alphabetic, u should convert it on date and after that just sort it on the right panel.