From 22c0d75d4e4c87035a80b7a9be1f03456ea5fa04 Mon Sep 17 00:00:00 2001 From: roman <72446685+diveart@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:56:27 +0200 Subject: [PATCH] Update fct__monthly__financials.sql --- models/core_/fct__monthly__financials.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/core_/fct__monthly__financials.sql b/models/core_/fct__monthly__financials.sql index 6c89edf2..14d9df73 100644 --- a/models/core_/fct__monthly__financials.sql +++ b/models/core_/fct__monthly__financials.sql @@ -26,7 +26,7 @@ WITH final AS ( {% if target.name == 'sf' %} SELECT date_trunc('month', sub_created_at) as date_month - , count(distinct org_id) as cnt_subscribers + , count(distinct org_id) + 1 as cnt_subscribers , sum(sub_price) as sum_revenue FROM {{ ref('dim__orgs') }} WHERE sub_created_at is not NULL @@ -35,7 +35,7 @@ WITH final AS ( {% elif target.name == 'db' %} SELECT date_trunc('month', sub_created_at) as date_month - , count(distinct org_id) as cnt_subscribers + , count(distinct org_id) + 1 as cnt_subscribers , sum(sub_price) as sum_revenue FROM {{ ref('dim__orgs') }} WHERE sub_created_at is not NULL @@ -44,7 +44,7 @@ WITH final AS ( {% elif target.name == 'bq' %} SELECT TIMESTAMP_TRUNC(sub_created_at, month) AS date_month, - COUNT(DISTINCT org_id) AS cnt_subscribers, + COUNT(DISTINCT org_id) + 1 AS cnt_subscribers, SUM(sub_price) AS sum_revenue FROM {{ ref('dim__orgs') }} WHERE NOT sub_created_at IS NULL @@ -53,7 +53,7 @@ WITH final AS ( {% else %} SELECT date_trunc('month', sub_created_at) as date_month - , count(distinct org_id) as cnt_subscribers + , count(distinct org_id) + 1 as cnt_subscribers , sum(sub_price) as sum_revenue FROM {{ ref('dim__orgs') }} WHERE sub_created_at is not NULL