How to get a unique Row ID with an OVER function.

How to get a unique Row ID with an OVER function.

book

Article ID: KB0080286

calendar_today

Updated On:

Products Versions
Spotfire Analyst All supported versions

Description

How to get a unique Row ID with an OVER function? Columns A and B are in the raw data, column C is a calculated value "count(Sales) OVER Store". Then you want to assign a unique RowID value as shown in column D so that it restarts the count for each duplicate entry.  What is the best way to do this?

 


Issue/Introduction

How to get a unique Row ID with an OVER function.

Environment

All supported environments.

Resolution

Unfortunately, you cannot use the RowId() function with OVER. The best approach available is to use a call to the rank() function:

     rank([Store],"asc","ties.method=first",[Sales])