Weld logo
hubspot logo
Hubspot

Deals by deal stage

Retrieves the number of deals in each stage of the sales pipeline from HubSpot and groups them by their respective stage labels.
1select
2    pipeline_stage.label as deal_stage
3  , count(*) as number_of_deals
4from
5    {{raw.hubspot.deals}} as deals
6    left join {{raw.hubspot.pipeline_stage}} as pipeline_stage on pipeline_stage.stage_id = properties_dealstage
7group by
8    pipeline_stage.label
Example of output from model:
+----------------------+-----------------+
|      deal_stage       |  number_of_deals |
+----------------------+-----------------+
|     Appointment      |        10       |
+----------------------+-----------------+
|     Qualification    |        25       |
+----------------------+-----------------+
|     Presentation     |        15       |
+----------------------+-----------------+
|     Negotiation      |        5        |
+----------------------+-----------------+
|     Closed Won       |        20       |
+----------------------+-----------------+
|     Closed Lost      |        5        |
+----------------------+-----------------+

This SQL model allows you to easily track the number of deals in each stage of your sales pipeline. By selecting the pipeline_stage.label as deal_stage and counting the number of deals, you can quickly see how many deals are in each stage of your pipeline. This information can be incredibly useful for sales managers who want to identify bottlenecks in their sales process and make data-driven decisions to improve their team's performance. The SQL code is integrated with HubSpot, so you can easily access your data and generate insights that will help you close more deals. With the Deals by Deal Stage SQL template, you can take your sales pipeline management to the next level and drive more revenue for your business.

Ready to start modeling your own hubspot data?

Get started building your data warehouse with hubspot and connect all your apps and databases.

hubspot logo
Weld logo
Sign up for free
Weld logo

Tired of scattered data? Sync your data in minutes with our AI-powered ETL platform. Seamlessly connect all your apps, files, and databases.

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