- Have you ever wondered what the difference is between Rank and DenseRank?
The Spotfire Rank function is a very commonly used function, especially in oil and gas, as it is commonly used to calculate days on production. There is another function listed called DenseRank that performs a similar function. However, from the description provided in the software, it’s not clear what the difference is between then. Both functions are described as follows: Returns an integer value ranking of the values in the selected column. The first argument is the column to be ranked.
So, I threw together a quick example to explain the difference between them.
The exact expressions used were:
As you can see, when ties happen, the Rank function sees the tie as more than one value, whereas, the Dense Rank sees the tie as a single value and continues counting.
Guest Spotfire blogger residing in Whitefish, MT. Working for SM Energy’s Advanced Analytics and Emerging Technology team!