Calls 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
+------------------+-------+
| 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.