This query calculates the total forecasted revenue per month. It does not include deals that were either closed won or closed lost.
SELECT date_part(YEAR, close_date) AS "Close Year" , date_part(MONTH, close_date) AS "Close Month" , sum(forecast_amount) AS "Pipeline - Forecasted Amount" FROM hubspot_deals_consolidated WHERE deal_stage NOT IN ('closedwon', 'closedlost') GROUP BY 1, 2 ORDER BY 1, 2;
||Year of closing date.|
||Month of closing date.|
||The total forecasted revenue.|