Weld logo
hubspot logo
Hubspot

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.
1select
2    concat(owners.firstName, ' ', owners.lastName) as owner
3  , count(*) as calls
4from
5    {{raw.hubspot.engagements}} as engagements
6    left join {{raw.hubspot.owners}} as owners on cast(owners.id as integer) = engagements.ownerId
7where
8    type = 'CALL'
9group by
10    owner
Example of output from model:
+------------------+-------+
|      owner       | calls |
+------------------+-------+
| John Smith       |   10  |
| Jane Doe         |   5   |
| Michael Johnson  |   3   |
| Sarah Williams   |   2   |
+------------------+-------+

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.

Ready to start modeling your own hubspot data?

Get started building your data warehouse with hubspot and 100+ more apps and databases available.

hubspot logo
Weld logo
Sign up for free
Weld logo

Tired of scattered data? Sync and analyze your data with AI in minutes. Connect to 150+ apps, files and databases.

Backed by leading investors
Frontline logoCherry logoInnnovation Fund logo
Twitter LogoLinkedIn Logo
GDPR logoSOC2
© 2024 Weld. All rights reserved.