Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

nakul1001
Contributor II

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

Re: Sorting chart based on calculated expression

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

6 Replies
ecolomer
Honored Contributor II

Re: Sorting chart based on calculated expression

in the expresion on Sorting label put this:

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

Not applicable

Re: Sorting chart based on calculated expression

Hi,

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

nakul1001
Contributor II

Re: Sorting chart based on calculated expression

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

nakul1001
Contributor II

Re: Sorting chart based on calculated expression

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

Not applicable

Re: Sorting chart based on calculated expression

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

nakul1001
Contributor II

Re: Sorting chart based on calculated expression

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