
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use rank function
Hi,
i have a table as below , I need to rank the suppliers region wise .So based on average weight, i rank a supplier only specific to that region . So every region would have its separate ranking based on weights.
Region | Supplier Name | Average weights (Weight*KPI's) | Rank region wise |
APAC | xyz1 | 7.75 | 1 |
APAC | xyz2 | 7.5 | 2 |
APAC | xyz3 | 5.7 | 3 |
Europe | abc4 | 4.4 | 1 |
Americas | ghi5 | 6.3 | 1 |
Americas | ghi6 | 6.05 | 2 |
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I answered for Qlikview.
Load the data.
Insert a straight table and add
Region and Supplier name as dimensions and
use
Average weights as measure and
Rank(sum(Average weights(Weight*KPI's))) as rank expression. Please find the attachment

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
if I'm correct.
in the script, load datas in a table.
then load a resident table with average weight group by region.
then load another resident table with autonumber(average weight) as rank order by average weight.
regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like this??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shiva thanks for replying ..
Sorry but i have new to Qliksense..can you let me know step by step how to see the ranking as an output :
Below is what it's there in your .qvw file. How to add a additional column with region wise ranking . Is there any formula for this ?
load * inline [
Region,Supplier Name,Average weights(Weight*KPI's)
APAC,xyz1,7.75
APAC,xyz2,7.5
APAC,xyz3,5.7
Europe,abc4,4.4
Americas,ghi5,6.3
Americas,ghi6,6.05];

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can try this loading script, then create a table with fields of DATA_RANK ordered by Rank_weight.
[DATA]:
load * inline [
Region, Supplier_name,Average_weights
APAC,xyz1,7.75
APAC,xyz2,7.5
APAC,xyz3,5.7
Europe,abc4,4.4
Americas,ghi5,6.3
Americas,ghi6,6.05];
[DATA_RANK]:
Load
Region,
Supplier_name,
Average_weights,
AutoNumber(Average_weights) as Rank_weight
Resident [DATA] ORDER BY Average_weights desc ;
drop table [DATA];

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for ranking by region, you can use in your table a mesure with:
=aggr(rank(sum(Average_weights)), Region, Rank_weight)
in script you can use autonumber() or rowno() as Rank_weight.
regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I answered for Qlikview.
Load the data.
Insert a straight table and add
Region and Supplier name as dimensions and
use
Average weights as measure and
Rank(sum(Average weights(Weight*KPI's))) as rank expression. Please find the attachment

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Shiva .It works
