Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
divya_anand
Creator III
Creator III

Sort a bar chart based on 2 fields not already in the chart

Hi all,

I am trying to sort a bar chart based on 2 fields - Week & Field. As you can see in the table below, it is sorted based on the fields Week & Field, of course I could achieve this because I included the two fields in the table (as expressions) and sorted. Here's my question - Is it possible to sort the bar chart just like in the table?

I've attached a sample qvw.

1 Solution

Accepted Solutions
sunny_talwar

Sort using this

=FirstSortedValue(Week*1000 + Field, -Aggr(Sum(value), Product, Week, Field))

View solution in original post

4 Replies
Clever_Anjos
Employee
Employee

Capturar.PNG

divya_anand
Creator III
Creator III
Author

Hi Clever Anjos,

Thank you for the response.

This actually sorts based on the expression and not based on Week & Field.

If I changed the value of (Product=C, Week=4, Field=10) from 999 to 910, then the sorting changes in the chart

But you see that the sorting in the table remains the same because the table has been sorted based on Week & Field, which I am looking for.

Any thoughts?

sunny_talwar

Sort using this

=FirstSortedValue(Week*1000 + Field, -Aggr(Sum(value), Product, Week, Field))

View solution in original post

divya_anand
Creator III
Creator III
Author

Hi Sunny,

This works. Thank you.