Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pizknock
Contributor
Contributor

Rank function with matrix table

Is it possible to use the rank() function over a matrix table. I am able to use rank and hrank for columns and rows but need the combination of the two. See the example below for an idea of what I'm trying to accomplish. The first table is the raw figures and the second is the desired ranking. I'm able to perform this type of ranking in Python but need to offer some filter options in the visualization, thus, I need to calculate the ranking within Qlik.

Raw figures    
sales store1 store2 store3
product1 5642 2468 9877
product2 462 544 322
product3 7888 3555 8791
       
Rank      
sales store1 store2 store3
product1 4 6 1
product2 8 7 9
product3 3 5 2

 

Labels (2)
1 Solution

Accepted Solutions
pizknock
Contributor
Contributor
Author

Thanks for the response. I needed to take it a step further to make it work fully. 

The code below worked for me.

=Aggr(Rank(TOTAL Sum(sales), 1,1), store, product)

View solution in original post

2 Replies
SerhanKaraer
Creator III
Creator III

Hello pizknock,

try this as measure, considering your measure is sales.

aggr(rank(sales),sales)

pizknock
Contributor
Contributor
Author

Thanks for the response. I needed to take it a step further to make it work fully. 

The code below worked for me.

=Aggr(Rank(TOTAL Sum(sales), 1,1), store, product)