Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
patroser
Partner - Creator
Partner - Creator

Problem sorting chart with conditional expressions

Hi there,

I've an issue sorting my chart.

The use case is, that I have a chart calculating values for the last 12/24 rolling months or 4/8 rolling quarters. Therefore my chart shows wheter 4, 8, 12 or 24 columns, depending on the selection of type (quarterly/monthly) and duration (12/24 months).
To sum those values up I've got one more expression calculating the total of the last 12/24 rolling months or 4/8 rolling quarters.

I'd like to always sort my chart by this total column, but as soon as I change one of the options type or duration the chart loses the sort setting of sorting by this Total column descending.

Attached you can find a sample application with the same problem.

I'd like to sort by the total column, therefore I change the priority of the total column in the chart to the top and select sort by numeric value descending.

As soon as i switch the type, the sort order is set to default again.

Any suggestions how I could avoid this problem?
I don't want to change the straight table to a pivot chart.

Thanks in advance

Patrick

13 Replies
patroser
Partner - Creator
Partner - Creator
Author

Thanks for your advice, I think this will work for my client

Patrick

patroser
Partner - Creator
Partner - Creator
Author

Thanks!

This also looks good, but:

I'm wondering, if we conditionally hide the column instead of the expression, I guess the engine still does the math for all the columns, right?
Doesn't matter in the specific case, because there's not that much to calculate, but in cases of millions of rows, I'm afraid this solution has a significant impact on the performance.

Or am I getting it wrong?

Patrick

settu_periasamy
Master III
Master III

Hi Patrick,

Actually, I tried with this (conditionally hide the column instead of the expression) application which is having millions of records. I don't find any performance issue.

May be some experts will give the proper answer for this.

patroser
Partner - Creator
Partner - Creator
Author

Just 4 Info:

I think I figured out, that just hiding the column instead of the expression is indeed of better performance.

We had close to 40 conditional expressions.

Working with the qvw itself wasn't a problem, but working via "open in server" took about one minute to load the chart containing the conditional expressions.

Switching the condition from expression to column improved the performance. Afterwards it just took a few seconds to load the chart.