How to create a dynamic Rank scroll

by Charalambos Pavlou

The goal here is to get a ranking that when you select a bar the next 5 and previous 5 ranks show as well with your chosen player/dimension.

First we want to start off by building a rank calculation like the one shown below you should use rank unique as this makes sure the ranks are unique so no duplicate ranks which can occur if you use the normal rank function.

You then want to put this rank calculation on the columns as a measure and then put this on the rows as well by changing it into a dimension (ctrl drag to duplicate then right click change to measure).

Then lets create a set from the name dimension just select one name when creating the set.  We also want to see the rank with the players name so the calculation below gives us the players rank along with their name. As you cant mix different data types we have used the str function to convert the rank to a string which can then be added to the name field which is also a string field, however we also need to put name in a min function (or max) just to aggregate the function and allow it to be added to our string rank then I have just put an empty string in the middle to break up the sentence.

we then need to add the name, rank + name and name set to the rows to help us follow what is happening, as well as add the name set to colour.

We can then set up a set action like shown below this allows you to click on the chart and change the name that is in the set.

You should end up with something looking like the image above and when you click on a bar that should then be blue and in the set. next we want to format all the table calculations. You want to right click on the fields with the delta symbol and go edit table calculation then select specific dimensions and make sure the name and name set are selected for all of them

Then we want it so only the ranks 5 above and 5 below are shown this can be done with the calculations below. the selected player one is looking across all the names with window max and saying if the name set is picked return us the rank. Then we want to know the ABS(absolute) value by taking away this selected player calculation from the rank but only for when 5 is greater than or equal to.

Now we want to put this true false statement onto filter and set to true. but make sure this table calculation is set the same way as the ones above by right clicking and editing the table calculation (specific dimensions name and name set), if you need to re format it then go back and set to true again otherwise this won't work. Now that's all done it should look like the original image and when you select a bar it re centres with 5 ranks above and 5 below.

Avatar

Charalambos Pavlou

Fri 29 Jul 2022

Thu 28 Jul 2022

Wed 27 Jul 2022

Tue 26 Jul 2022