Discussion Board for collaboration on QlikView Management.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for
Did you mean:
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
Master II

Maybe like this:

script:

``````Map:
Wight ID, Wight
1, 30
2, 40
3, 30
];

Test2:
ApplyMap('Map',[Wight ID],Null())*Value as Index;
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

2 Replies
Master II

Maybe like this:

script:

``````Map:
Wight ID, Wight
1, 30
2, 40
3, 30
];

Test2:
ApplyMap('Map',[Wight ID],Null())*Value as Index;
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

Support (Former)

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.