Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting of bar chart.

-

1 Solution

Accepted Solutions
IAMDV
Master II
Master II

Hi saffatwist,

You are doing right! I had checked your sort expression and it is perfect. However there is seems to be line break in your Classifiction Field. If you export the Classification Field to Excel and copy the text in to your sort expression it works fine. Or else you can try the below expression because it works for me...

=Sum ({$<Classification={'First class honours
'}>} [MeasureScore])/Sum (Total <ShortName> MeasureScore)

So the problem is with raw data. There is a line break and your 'First class hounours' is not getting evaluated in the sort expression. Using excel is the best way to troubleshoot with string data types.

Also uncheck other sort types (I am assuming that you are just testing them...)

I hope this helps and please mark the post answered if this helps!

View solution in original post

3 Replies
IAMDV
Master II
Master II

Hi saffatwist,

You are doing right! I had checked your sort expression and it is perfect. However there is seems to be line break in your Classifiction Field. If you export the Classification Field to Excel and copy the text in to your sort expression it works fine. Or else you can try the below expression because it works for me...

=Sum ({$<Classification={'First class honours
'}>} [MeasureScore])/Sum (Total <ShortName> MeasureScore)

So the problem is with raw data. There is a line break and your 'First class hounours' is not getting evaluated in the sort expression. Using excel is the best way to troubleshoot with string data types.

Also uncheck other sort types (I am assuming that you are just testing them...)

I hope this helps and please mark the post answered if this helps!

IAMDV
Master II
Master II

Just to add one more point - Your Subject field seems to be right, unlike the Classification Field. I would strongly recommend you to clean up the data in the script. You are having this problem because of Carriage Return.

Good luck!

Not applicable
Author

Hello saffatwist,

DV is right. I tested it in a little other way. I took via copy/paste the value(!) directly out of the listbox. AND ... there is really a CR and/or a LF in your fieldvalue. Meanwhile I went to dinner, so I am too late with my answer.

=Sum ( {< Classification={'First class honours
'} >}MeasureScore)
/Sum (Total <ShortName> MeasureScore)


will work for the moment, but much better is, as DV still mentioned, cleaning the data during load.

Regards, Roland