Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sorting chart based on calculated expression

Hello QlikView experts,

I am writing to understand the behavior of bar chart dimension sorting based on the value of calculated expressions used in it. I've attached 2 screenshots to illustrate the challenge I am facing. In the chart properties > Sort tab I am using the same expression as the one in the Expressions tab to get the data sorted in descending order. Data is not getting sorted using that expression and I guess this could be because the expression is a combination of variables and previous columns. Not sure if QlikView is not establishing the relation of this calculated expression value w.r.t the dimension in the chart. Hope the attached screenshots help explain the situation.

In the screenshot you will see how I am using first 6 expressions but not displaying them. The last 2 expressions are having bar option selected for display and the value for these last 2 expression comes from the previous 6 expressions.

Could there be a different approach to this? To get the chart sorted on the expression value, how to go about it?

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

And if you change the order of expressions? Sorting by Y-value sorts by values of first expresion, even though it is not displayed.

View solution in original post

6 Replies
ecolomer
Master II
Master II

in the expresion on Sorting label put this:

=only({1} match(your expression))

Not applicable
Author

Hi,

Did you try sorting by value instead of sorting by expression?

Anonymous
Not applicable
Author

Thanks for the reply Enrique! I tried your expression but it keeps saying error in expression and I do not get the sorting done.

Anonymous
Not applicable
Author

Hi Nannyogg, Yes I tried both Y value and Numeric value sort. But it is not sorting the data.

Not applicable
Author

And if you change the order of expressions? Sorting by Y-value sorts by values of first expresion, even though it is not displayed.

Anonymous
Not applicable
Author

This did the trick! First I was getting all -ve values but I guess it was because of some calculation errors at my side and selection criteria. I tried it one more time, by changing the order of expressions (expression that I need sorting on is first in the chart expression list). As of now I believe this is working! Thanks nannyogg