Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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