
Hi Experts
I am a beginner in using Tableau and I wanted to sort/rank the vehicle units(fender) by their sum of diiferences which have been calculated by week. For instance, fender a has a total of 700 till date from sum of diiferences as ranked 1, fender b as rank 2 and so on.
I have been struggling to rank them and have attached my workbook.
Appreciate if you could please have a look at the workbook under tab 'Sorting'.
Regards
Kanu

Hi Kanupriya,
This might be a good opportunity to use the Rank() Calculation as a means of sorting. Given that your weekly difference is already a table calculation, using more table calculation is best in this use case; i created a few more to help with this rank/sort:
- [Weekly Difference] = ZN(SUM([Mileage])) - LOOKUP(ZN(SUM([Mileage])), -1) //this is just your weekly difference calculation saved off so that it can be referenced (see: saving and customizing table calculations)
- [Sum of Weekly Difference]=WINDOW_SUM([Weekly Difference]) //Sum of the difference across all weeks for each vendor
- [Rank by Sum of Weekly Difference] = RANK([Sum of Weekly Difference]) //Ranking based off the prior sum.
I've attached the original workbook with the solution implemented.