Calls by owner
Retrieves the number of calls made by each owner in HubSpot and displays it alongside their first and last name. It uses a left join to connect the engagements and owners tables and filters the results to only include calls. The output is grouped by owner.
- Grain
- See the notes
- Built from
- 2Raw tables
- 1Core
- 1Analytics
- Reads from HubSpot
- engagementsowners
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.hubspot.calls_by_owner
2-- Calls by owner. Retrieves the number of calls made by each owner in HubSpot and
3-- displays it alongside their first and last name. It uses a left join to connect
4-- the engagements and owners tables and filters the results to only include calls.
5-- The output is grouped by owner.
6--
7-- From the weld.app template library. Not reconciled against HubSpot;
8-- check the output against the source before relying on it.
9
10select
11concat(owners.firstName, ' ', owners.lastName) as owner
12, count(*) as calls
13from
14{{raw.hubspot.engagements}} as engagements
15left join {{raw.hubspot.owners}} as owners on cast(owners.id as integer) = engagements.ownerId
16where
17type = 'CALL'
18group by ownerThis model and the 1 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().
How it counts. And where it stops.
This template allows you to easily track the number of calls made by each owner in your organization. The SQL code selects the first and last name of each owner, along with the total number of calls they have made. This information is obtained by joining the engagements table with the owners table, and filtering for calls only. The resulting output is a table that displays the name of each owner and the number of calls they have made. This information can be used to identify top performers, track progress over time, and make data-driven decisions about your sales strategy. With the Calls by Owner SQL template, you can gain valuable insights into your sales team's performance and optimize your sales process for maximum efficiency.
Raw tables it reads
- raw.hubspot.engagements
- raw.hubspot.owners
Put HubSpot in front
of your agents.
Connect HubSpot, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.