8 Replies Latest reply: Sep 22, 2016 4:28 PM by Ugonna Okoli RSS

    Qlik Sense Bar Chart

    Hari Nag

      Hi All,


      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.



      Bar Chart.PNG

        • Re: Qlik Sense Bar Chart
          Ugonna Okoli

          Try sorting the Monthname dimension numerically in descending order; Properties Panel --> Sorting --> Sort Numerically --> Ascending


          • Re: Qlik Sense Bar Chart
            Lech Miszkiewicz

            Hello Hari


            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





            • Re: Qlik Sense Bar Chart
              jagan mohan rao appala

              Hi Hari,


              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

              FROM DataSource;


              Now use MonthYear field as dimension, if it is not sorted automatically then in Sort tab select Sort Numerically option.


              Hope this helps you.




              • Re: Qlik Sense Bar Chart
                berk armagan

                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.

                • Re: Qlik Sense Bar Chart
                  Lakshmikandh Karthikeyan

                  Hi Hari,


                  Use Sort by Expression and just give the DateColumn in that place that will solve your issue.




                  • Re: Qlik Sense Bar Chart
                    Hari Nag

                    Thank you for all your response. It got solved.