Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
mkb_Qlik
Contributor III
Contributor III

Sorting Qliksense bar chart in chronological order

Hi,

Kindly help me to sort to show below chart in chronological order of month. In this i am comparing Current year vs last year data.

 

clipboard_image_0.png

 

Normal view giving me the chart in chronological order if i select particular year say 2019, chart alignment is going like above screenshot. Kindly help to fix this.

 

my expression:

Measure 1: Sum({$<ID ={'$(v_ID)'},Year = {'$(vMaxYear)'},Month_Name=,Month_Year=>}value)
Measure 2: Sum({$<ID ={'$(v_ID)'},Year = {'$(vMaxYear-1)'},Month_Name=,Month_Year=>}value)

Thanks in advance.

 

 

Labels (2)
3 Replies
Vegar
MVP
MVP

How doea the chart sorting property look like? You could try to change it to this expression with ascending  order.

=Only({1}Month)

mkb_Qlik
Contributor III
Contributor III
Author

HI  Vegar,

I used expression to sort the month in chronological order but this is working well in normal view.

 

When i filter 2019 data then alignment getting jumpled.

Vegar
MVP
MVP

Hmm... it's hard to say without looking at the application. It looks like you are not getting any sort order value for your unsorted months. 

You could try to only sort by last years months by applying your set.

=Only({$<ID ={'$(v_ID)'},Year = {'$(vMaxYear-1)'},Month_Name=,Month_Year=>}Month)

 

If this doesn't work it then my tip is to do the following in order to understand what's going on.

  • Make a copy of your chart 
  • Transform it into a straight table
  • Add your sort order expression as a measure in your table
  • Adjust it so you get a numeric value per row that correspond to your desired sort order
  • Copy this expression back into the sort order for your original chart.

Good luck