Hi, I read about both the rank and denserank and tried them both but I’m getting “unavailable”. Currently I have Data (has repetitions), ID (has repetitions), Date (has repetitions) columns and would like to give index values. The function I currently have is: rank([{ID} ASC],[{Date}],PRE_AGG).
To be honest, I don’t need to sort the Id by neither ASC or DESC - the table that I currently have is in the perfectly correct order, it’s just that I need a column with incrementing values. The reason why I used this function is because I needed to make sure lines with same IDs stay together + have ASC order for dates (most current date is sorted last). I hope I’m making sense - any suggestions on why I may be getting unavailable would be great. Thank you!
Hi @Soyoon,
Using rank and denserank when dealing with duplicates will be tough as neither will assign a unique value per row. denserank will assign duplicate values the same rank. Rank, while recognizing duplicates, it still will not provide each row a unique value even though it would be accounted for in the count or rank.
Do you have any other field that would be unique to each row, that you could use along with distinct count? You could then ‘hide’ that field from your visual so that you’re still only showing the data you’d like to view.
Hi @Soyoon,
It’s been awhile since we last heard from you; do you have any additional questions or did this help with your solution? If we do not hear back within 3 business days, I’ll go ahead and close out this topic.
Hi @Soyoon,
Since we have not heard back from you, I’ll go ahead and mark the solution. However, if you have any additional questions, feel free to create a new topic in the community and link this discussion for relevant information.
Hi, so sorry for the late response - wasn’t sure if I should close this question somehow. I think you’ve answered my question for now! Thank you very much