AVG function with Rank or TopN
Has anyone figured out a workaround for calculating the Average for a ranked rowset?
Basically, we want to calculate the average for top 20 products. We calculate a rank for each product using TOPN.
However, when using the AVG or similar functions to get the average, it always divides by the entire dataset, not just the top 20.
any insight would be appreciated.
thanks