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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank in pivot table

Hi everybody,

I have a pivot table with 2 dimensions, Quarter and Area and some expressions.

This pivot table is shown only when the user select only one company because there are some expressions about the market (= all companies) and some others about the selected company.

My pivot table is like this (dimensions in bold and expressions in italic)

Area                                                              Q1       Q2       Q3       Q4

North America      

  Sales Market                                              100     120     110     140

  Sales Selected Company                            30        40        25        50

  Rank Company                                            2          2          2          2                     

South America      

  Sales Market                                              110     125     130     140

  Sales Selected Company                            35        30        20        40

  Rank Company                                            1          1          1          1

Among my expressions, I need to calculate the rank but if I use this expression : =rank(sum({<$(CTXT_COMPANY),$(CTXT_REBATES)>}SALES)), the rank calculated is 1 or 2 because it’s calculated for only the selected company among Area.

I would like calculate the rank of the selected company among all companies, by area.

Could you help me for this ?

Thank you

Regards

Bérengère

20 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: rank(TOTAL sum({<$(CTXT_COMPANY),$(CTXT_REBATES)>}SALES))


talk is cheap, supply exceeds demand
Not applicable
Author

Hello Gysbert,

Thank you for your response. Unfortunately, I tried this and the result is the same.

Regards

Bérengère

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Can you post an example document that demonstrates the problem?


talk is cheap, supply exceeds demand
Not applicable
Author

Here is an example of my problem.

Thank you

Regards

Bérengère

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Well, you can show the correct numbers with =rank(TOTAL sum({<Company>}Sales)). But then you will get all companies in the chart even if you select only one company in the list box.


talk is cheap, supply exceeds demand
Not applicable
Author

Yes but as you said, I get all companies in the pivot table and not only the selected company...

Clever_Anjos
Employee
Employee

Try this:

=if(Column(1) > 0,rank(TOTAL sum({<Company=>}Sales)))

Not applicable
Author

Hello Clever,

Thank you for your response. Results of expressions for others companies are 0 or null but they still appear in the pivot table.

Regards

Bérengère

Clever_Anjos
Employee
Employee

Weird... It worked here

Capturar.PNG.png