Pharma Commercial Analytics Path · Mission 4 of 25Easy

Calls per rep

First aggregation on fact_calls. Rep call activity is the field-force productivity headline; sales managers run this view every Monday to spot under-performers and over-performers. Two-table join, GROUP BY on the dimension's name column.

The Brief

Hannah ReedSales Operations Managerslack-dm

Monday morning rep activity — Marcus is reviewing the field force at 11. Give me total call counts per rep over the full 24-month window, joined to dim_rep so we get the rep_name on the page (not just rep_id). Two columns: rep_name and call_count, sorted by call_count descending so the top callers lead. We're going to spend most of the meeting on the bottom of the list — anyone under 100 calls in 24 months is a coaching conversation.

You'll practice

GROUP BYCOUNT(*)ORDER BY

Tables & columns available

fact_callsfact7 columns
ColumnTypeKey
call_idINTPK
hcp_npiTEXTFK → dim_hcp
rep_idINTFK → dim_rep
product_idINTFK → dim_product
call_dateTEXT
duration_minINT
samples_droppedINT
dim_repdim4 columns
ColumnTypeKey
rep_idINTPK
rep_nameTEXT
manager_nameTEXT
territory_idINTFK → dim_geography

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Two-table join: fact_calls to dim_rep on rep_id. Group by the rep's human-readable name so the report header is meaningful.

Hint 2

COUNT(*) aliased as call_count. No date filter — Marcus wants the full 24-month window for the activity baseline.

Hint 3

Descending sort on the call_count surfaces the top performers up top so managers can scan past them quickly to the bottom — that's where the meeting will focus.