New contacts by month
Retrieves the number of new contacts added to HubSpot each month and groups them by month. It uses the date_trunc function to extract the month from the createdAt field and orders the results by month.
- Grain
- See the notes
- Built from
- 1Raw tables
- 1Core
- 1Analytics
- Reads from HubSpot
- contacts
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.hubspot.new_contacts_by_month
2-- New contacts by month. Retrieves the number of new contacts added to HubSpot each
3-- month and groups them by month. It uses the date_trunc function to extract the
4-- month from the createdAt field and orders the results by month.
5--
6-- From the weld.app template library. Not reconciled against HubSpot;
7-- check the output against the source before relying on it.
8
9select
10date_trunc(createdAt, month) as month,
11count(*) as contacts
12from
13{{raw.hubspot.contacts}}
14group by
15month
16order by
17monthThis 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 SQL model allows you to easily track the number of new contacts added to your HubSpot database each month. By using the date_trunc function, the SQL groups contacts by the month they were created, providing a clear picture of how your contact list is growing over time. This information can be used to identify trends in your lead generation efforts, and to make data-driven decisions about how to allocate your marketing resources. With the New Contacts by Month SQL template, you can gain valuable insights into the effectiveness of your marketing campaigns and make informed decisions about how to optimize your lead generation efforts.
Raw tables it reads
- raw.hubspot.contacts
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.