Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
h_prakash
Not applicable

Qlik Sense Bar Chart

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.

Thanks

Bar Chart.PNG

1 Solution

Accepted Solutions
h_prakash
Not applicable

Re: Qlik Sense Bar Chart

Thank you for all your response. It got solved.

8 Replies
okolyug16
Not applicable

Re: Qlik Sense Bar Chart

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

Capture.PNG

Lech_Miszkiewicz
Not applicable

Re: Qlik Sense Bar Chart

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):

     Load

          ...

          Dual(MonthYear , autonumber(MonthYear,'MonthYear') as MonthYear

     from

          YOUR_Source

     ;

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

hth

Lech

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
jagan
Not applicable

Re: Qlik Sense Bar Chart

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

LOAD
*,

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.

Regards,

Jagan.

berkarmagan
Not applicable

Re: Qlik Sense Bar Chart

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.

lakshmikandh
Not applicable

Re: Qlik Sense Bar Chart

Hi Hari,

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

Thanks,

Lakshmikandh

h_prakash
Not applicable

Re: Qlik Sense Bar Chart

Thank you for all your response. It got solved.

shraddha_g
Not applicable

Re: Qlik Sense Bar Chart

In Sort by Expression, You can have MonthStart field if you have created in Script and use that field for Sorting.

okolyug16
Not applicable

Re: Qlik Sense Bar Chart

Please, mark the CORRECT/HELPFUL comments.