Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9076

Re: Ranking Top N but excluding ties at Nth position

$
0
0

For tie only in Nth position, let me share a POC I did in BO 4.1 SP3 :

 

Let's assume the initial data grid as :

 

Dimension

 

 

Measure

 

 

A

 

 

10

 

 

B

 

 

9

 

 

C

 

 

8

 

 

D

 

 

7

 

 

E

 

 

5

 

 

F

 

 

5

 

 

G

 

 

5

 

 

H

 

 

5

 

 

I

 

 

2

 

 

Create variables as :

v_Rank ="Rank"+Rank([Measure])

(Assuming top 5) v_Top N =If(Count([v_Rank] Where (Rank([Measure])<=5) In ([Dimension]);All)In Block >5;4;5) 

v_FilterFlag =If(Rank([Measure])<=[v_Top N];1;0)

 

Now create a block level filter as : v_FilterFlag Equal To 1

 

You are done

 

 

Dimension

 

 

Measure

 

 

A

 

 

10

 

 

B

 

 

9

 

 

C

 

 

8

 

 

D

 

 

7

 

 

Now, if I change the value at 5th position to remove the tie, we get:

 

Dimension

 

 

Measure

 

 

A

 

 

10

 

 

B

 

 

9

 

 

C

 

 

8

 

 

D

 

 

7

 

 

E

 

 

6

 

 

 


Viewing all articles
Browse latest Browse all 9076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>