Creating unique Row IDs in Tableau Prep
This is an extension to the ranking trick in Tableau Prep. Lets see how we can get unique row ids for below data.
Before going ahead, we need to make sure that there is a field that uniquely identifies each row. In our case, we can use the Name field, but if you have duplicate names, you can still get a unique field by creating a calculated field. This wont work if you have duplicate rows and you need to perform deduping first in that case.
Now create a self inner join with criteria [Sort Key] < = Sort Key. Please note that you need a dummy step so that you can join the data to itself.
Create an aggregation with following setting
Rename the aggregated field and add an output step, you are done.