Sequence Number column for a summarized saved search

Rank a search result by the sum of amount, grouped by item.

Solution:

As you are aggregating the results (MIN, MAX, SUM etc) you also need to aggregate the expression in the ORDER BY clause, so that the results returned by the ROW_NUMBER() function match up with the summarized results of the rest of the saved search. All you would need to do is add a SUM() around {amount}:

Formula(Numeric): ROW_NUMBER() OVER (ORDER BY SUM({amount}))

OR

Formula(Numeric): RANK() OVER(ORDER BY {internalid} ASC)

Leave a comment

Your email address will not be published. Required fields are marked *