HubSpot model

New deals by month

Retrieves the number of new deals created each month from HubSpot and organizes them by month.

Grain
See the notes
Built from
  1. 1
    Raw tables
  2. 1
    Core
  3. 1
    Analytics
Reads from HubSpot
deals
Ships as
Weld and dbt SQL, open source on GitHub
core.hubspot.new_deals_by_month
1-- core.hubspot.new_deals_by_month
2-- New deals by month. Retrieves the number of new deals created each month from
3-- HubSpot and organizes them by month.
4--
5-- From the weld.app template library. Not reconciled against HubSpot;
6-- check the output against the source before relying on it.
7
8select
9date_trunc(createdAt, month) as month,
10count(*) as deals
11from
12{{raw.hubspot.deals}}
13group by
14month
15order by
16month

This 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().

Notes

How it counts. And where it stops.

This SQL model allows you to quickly and easily analyze your sales data by grouping deals by the month they were created. By using the date_trunc function, the SQL template aggregates all deals created in a given month and returns the total number of deals for each month. This information can be incredibly useful for identifying trends in your sales data, such as which months are the busiest or slowest for your business. With this insight, you can adjust your sales strategy accordingly and optimize your sales performance. The New Deals by Month SQL template is a must-have for any business looking to gain a deeper understanding of their sales data and improve their bottom line.

Raw tables it reads

  • raw.hubspot.deals

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.