Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lindybrits
Contributor III
Contributor III

Sort pivot table rows by rank and date

Hi all!

I would really appreciate help on the following topic.

I have a pivot table that contains the Total Sales and Rank data per year (2014,2015,2016) and month for brands A-J. I was wondering if it would be possible to have two selection boxes - one for Year and the other for Month. If you select for instance 2014, then the table will be sorted according to Rank for Year 2014. On the same note, if you choose for instance Jan, it will sort according to Rank for Month Jan.

According to what I have seen, I cannot choose to sort by expressions in the pivot table.

See below the image. I have also attached sample data as well as the qvd.

table.png

This would be of great help!

I am looking forward to hearing from you guys.

1 Solution

Accepted Solutions
sunny_talwar

Can you check if this is working the way you expect? I can explain what its doing once you confirm

View solution in original post

8 Replies
lindybrits
Contributor III
Contributor III
Author

I apologise for the misprint - its qvw.

sunny_talwar

Can you check if this is working the way you expect? I can explain what its doing once you confirm

sunny_talwar

You don't have to use the button, I left it there by mistake. Your requirement is to change the sort order based on selection in Month or Year field, right? See if that is working or not

lindybrits
Contributor III
Contributor III
Author

Hi Sunny! On a yearly scale it seems to be working for 2014 and 2015 (rank descending though), for some reason 2016 is not working. When selecting a year as well as a month, it doesn't rank according to that specific month. Selecting only a month doesn't seem to deliver anything specific?

lindybrits
Contributor III
Contributor III
Author

It seems to be working perfectly, on my side, after adding your expression in the sorting tab as well (with brand). Find attached. What might the reason be?

sunny_talwar

So it is working now?

lindybrits
Contributor III
Contributor III
Author

Yes it does. Thanks a lot! I will mark as correct answer. Again, you came to the rescue!

sunny_talwar

Hahahaha, I provided the solution, but was not sure if you needed this or not. But I am glad we did end up getting to the right solution. I like the sorting expression method, but the other one is an alternative as well