Assign a Rank and a Count

TAM

Board Regular
Joined
Oct 10, 2008
Messages
114
I want to rank each rep(Mbrid), by highest GDC within each Practice_id. I also want to have a count of the number of members in Practice_ID, Here's the code I have so far that is working. I'm unclear how to assign a rank and a count within this query. Thanks in advance for help!!

SELECT [REP_FILE_12-22-2015].PLTFM, [REP_FILE_12-22-2015].POSITION, [REP_FILE_12-22-2015].Practice_ID, [REP_FILE_12-22-2015].Practice_Name, [REP_FILE_12-22-2015].MBRID, [REP_FILE_12-22-2015].Practice_StrtDate_Member, [REP_FILE_12-22-2015].Denominator_Indicator, Tbl_sales_metrics.[YTD_Sales], IIf([YTD_Sales]>600000,"yes","no") AS QualifiedGDC
FROM [REP_FILE_12-22-2015] LEFT JOIN Tbl_sales_metrics ON [REP_FILE_12-22-2015].MBRID = Tbl_sales_metrics.AdvisorNo
WHERE ((([REP_FILE_12-22-2015].PLTFM)=1) AND (([REP_FILE_12-22-2015].POSITION)=3) AND (([REP_FILE_12-22-2015].Practice_ID) Is Not Null))
ORDER BY [REP_FILE_12-22-2015].Practice_ID, Tbl_sales_metrics.[YTD_Sales] DESC;
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,221,816
Messages
6,162,149
Members
451,746
Latest member
samwalrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top