Formula for saved search to identify unique record...
# general
g
Formula for saved search to identify unique records - my saved search is looking at the results at line level and I want to tag each unique record with a number going up to however many records there are on the search... i.e. record A has 3 lines, all three lines have 1, the record B has 5 lines, all 5 have 2 etc etc till the last record on the saved search which can be 40 or 4000.. is there a formula to do this?
d
yes, use
DENSE_RANK()
and order by the same as your search results
for example, if you had a transaction search that was ordered by descending internal id, the formula would look like:
DENSE_RANK() OVER (ORDER BY {internalid} DESC)
g
thanks @David B, so what would I need to add within the brackets DENSE_RANK() for this to work? currently the results comes with
1
for all transactions regardless of the internal ID? currently formula numeric: DENSE_RANK() OVER (ORDER BY {internalid} DESC) - internal id descending...
d
as much as I hate to say it, it's working for me:
There is an aggregate version of
DENSE_RANK()
that takes expressions, but I can't get it to work. I've asked about this in the #C2A1ZEMF0 channel here
read more about the analytic and aggregate forms of `DENSE_RANK`: Oracle / PLSQL: DENSE_RANK Function