Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

QlikSense Sorting Issue

Hi,

I have a combo chart where I have added the QTR (quarter) as an alternative dimension. I also have a filter for QTR as well.

Both have been set to sort numerically and ascending.

Today I noticed the bars go Q12016 - Q22016 - Q42016 - Q32016. I created a new app using the same data source and had the same issue.


Any ideas what would cause this to happen?

1 Solution

Accepted Solutions
Highlighted
Master III
Master III

Change the sorting for QTR to expression   Date(Aggr(Max([Close Date]),QTR),'YYYY-MM')

hth

Sas

View solution in original post

6 Replies
Highlighted
Creator III
Creator III

May be it is considering the whole string while sorting.

Try to use custom sort on Quarter dimension as "=Num#(Mid(QTR,2,1))" and sort by Ascending.

Thanks.

Vikram

Highlighted
Creator III
Creator III

Hi,

  If possible, Share the sample file.

   Then only we can solve your issue.

Highlighted
Creator III
Creator III

Hi,

Can you share a sample one?

Highlighted
Contributor II
Contributor II

I've attached a sample file.

Highlighted
Contributor III
Contributor III

Hi Stewart,

I could not make much impact by changing any sorting properties in your app, so I used two different approaches. Depending on how difficult it is for you to do it, try either of them.

first approach - I exported the chart and reloaded the data and it worked perfectly well. Assuming it is possible for you to do that, try it. Make sure that the Q42016 is actually listed after the Q32016 in the order.

Second approach - this I normally use when either such kind of sorting anomalies are present or the sorting has to be forced customized to certain specific order. I use a if/wildmatch condition to assign numbers to the QTR dimension and then in the properties, do the sorting using this expression. This is what I have used for your example -

if(WildMatch(QTR, 'Q12016'),'1',

if(WildMatch(QTR, 'Q22016'),'2',

if(WildMatch(QTR, 'Q32016'),'3',

if(WildMatch(QTR, 'Q42016'),'4',

if(WildMatch(QTR, 'Q12017'),'5',

if(WildMatch(QTR, 'Q22017'),'6',

))))))

both of these approaches worked and produces the chart with Q42016 in the correct order as seen below -

qtr2.JPG

let me know if this works for you.

thanks,

Ajit

Highlighted
Master III
Master III

Change the sorting for QTR to expression   Date(Aggr(Max([Close Date]),QTR),'YYYY-MM')

hth

Sas

View solution in original post