There are multiple ways to rank items. In a ordinal scale (for example, how good is the product rating from 1-9), we have to define first there 1 means the best or the worst.
Often we see a rating star system on movie websites or amazon. We could also transfer our rating system into a star system. Let’s start.
For this example, I have a list of website with the ranking how good is each one scaling from 1-9, where 1 is the best and 9 is the worst.
1. Calculate the stars
If your ranking system is like mine (1 is the best) we have to reverse it. Because in the star system, the more is the better. My simple solution is using a calculated field to count the stars:
10-[Ranking]
By that now we have a new rating from 1-9, where the more stars, the better.
2. Transform the number to the stars

By using space and replace, we tell Tableau that simply for an amount of number (which represents the stars), we call out the same amount of blank spaces and replace each with a full star. The rest with be replaced with the white stars.
3. Be careful with the number format
So my rating numbers are already whole numbers, thus we could calculate it this way. If not you have to combine them with INT() or ROUND() function to have the whole number.
4. Optional: is it also possible with a haft star?
In some websites, items are rated into the haft (instead of choosing between 3 or 4 stars, users could give it 3,5/5 ttars). For this example I take my dataset and first transfer it into a 5 star system.
My calculation is ([Stars]+1)/2.
Instead of 1-9 stars we have now 1-5 stars, which the distance of 0.5. Note that this way is not really 100% exact because we do not have 0,5 star, but for the representative we could use that.
And the star calculation goes as following:

(I do not find a Unicode haft star so I use the black dot, white dot, and haft dot instead to demonstrate my idea here).
And this is final result in our project. Pretty cool, right?
