Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

NthMostfrequent function Expand / Collapse
Posted Tuesday, June 3, 2008 1:07 AM


Group: General Forum Members
Last Login: Monday, January 26, 2015 6:16 AM
Points: 114, Visits: 429
Hi,How to replicate the functionalities of Crystal's NthMostfrequent function in rdl?

Post #510443
Posted Wednesday, June 4, 2008 8:02 AM


Group: General Forum Members
Last Login: Monday, November 23, 2015 10:37 AM
Points: 2,555, Visits: 3,283
If you can create a result set that for each item, also has the quantity or frequency of that item, and if you can use SQL 2005, you can then use the ROW_NUMBER function over the item identifier, ordered by the frequency or quantity in descending order. From that result, you simply select the item with ROW_NUMBER of N, for the Nth most frequent. Does that make sense?

(aka smunson)

(aka sgmunson)

Helpful Investing Info
Healthy Living Info
Helpful Business Info
Post #511392
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse