Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikUser555
Contributor II
Contributor II

Wighted Ranking

Hello,

I would like to calculate the Rank of a individual country by different wights. The wights I want to adjust by a slider. The Slider is already build an writes to a new variable for every wight e.g.: vWight1 = 30, vWight2 = 40 and vWight3=30 (all Wights together are always 100). For every Country there are 3 different Values to build the Ranking. 

The Data looks like this:

Country  | Wight ID | Value

Germany | 1 | 34

Germany | 2 | 45

Germany | 3 | 12

UK | 1 | 42

UK | 2 | 76

UK | 3 | 98

USA | 1 | 67

USA | 2 | 65

USA | 3 | 13

 

The calculation should now for Germany be: 

30*34+40*45+30*12 = Index

And than I want to write to every country a new col with the Ranking 1 to inf ...

 

I have no Idea how to deal with this.

 

Greetings,

 

Tobias

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

Maybe like this:

 

script:

Map:
Mapping Load *Inline [
Wight ID, Wight
1, 30
2, 40
3, 30
];

Test2:
Load *, 
ApplyMap('Map',[Wight ID],Null())*Value as Index;
Load * Inline [
Country  | Wight ID | Value
Germany | 1 | 34
Germany | 2 | 45
Germany | 3 | 12
UK | 1 | 42
UK | 2 | 76
UK | 3 | 98
USA | 1 | 67
USA | 2 | 65
USA | 3 | 13
] (delimiter is |);

 

straight Table:

dimension:

Country

Expressions:

sum(Index)
rank(sum(Index))

 

hope this helps

View solution in original post

2 Replies
Frank_Hartmann
Master II
Master II

Maybe like this:

 

script:

Map:
Mapping Load *Inline [
Wight ID, Wight
1, 30
2, 40
3, 30
];

Test2:
Load *, 
ApplyMap('Map',[Wight ID],Null())*Value as Index;
Load * Inline [
Country  | Wight ID | Value
Germany | 1 | 34
Germany | 2 | 45
Germany | 3 | 12
UK | 1 | 42
UK | 2 | 76
UK | 3 | 98
USA | 1 | 67
USA | 2 | 65
USA | 3 | 13
] (delimiter is |);

 

straight Table:

dimension:

Country

Expressions:

sum(Index)
rank(sum(Index))

 

hope this helps

Brett_Bleess
Former Employee
Former Employee

Tobias, did Frank's post and sample app work for you? If so, please be sure to use the Accept as Solution button on his post to give him credit for the help as well as let others know things worked.  If you are still having trouble, please provide an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.