Weld logo

Emails by owner

Retrieves the number of emails sent by each owner in HubSpot by joining the engagements and owners tables and grouping the results by owner.
2    concat(owners.firstName, ' ', owners.lastName) as owner
3  , count(*) as emails
5    {{raw.hubspot.engagements}} as engagements
6    left join {{raw.hubspot.owners}} as owners on cast(owners.id as integer) = engagements.ownerId
8    type = 'EMAIL'
9group by
10    owner
Example of output from model:
|      owner       | emails |
| John Smith       |   25   |
| Jane Doe         |   18   |
| Michael Johnson  |   12   |
| Sarah Williams   |   8    |
| Robert Brown     |   5    |

This SQL model allows you to easily retrieve the number of emails sent by each owner in your HubSpot account. By joining the engagements and owners tables, this SQL template creates a comprehensive report that includes the first and last name of each owner, as well as the total number of emails they have sent. This information can be used to gain insights into the performance of your sales team, identify top performers, and optimize your email marketing strategy. With the Emails by Owner SQL template, you can quickly and easily analyze your email engagement data and make data-driven decisions to improve your business.

Ready to start modeling your own hubspot data?

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

Weld logo
Sign up for free
Weld logo

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

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