Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions models/core_/dim__orgs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ WITH orgs AS (
FROM {{ ref('signed__in') }}
GROUP BY 1


-- --dev
-- SELECT
-- org_id
Expand All @@ -28,7 +29,7 @@ WITH orgs AS (
org_id
, event_timestamp AS sub_created_at
, plan as sub_plan
, price as sub_price
, price
FROM {{ ref('subscription__created') }}
)

Expand All @@ -38,8 +39,8 @@ SELECT
, created_at
, num_users
, sub_created_at
, sub_plan
, sub_price
, case when num_users <= 1 then 'Individual' else sub_plan end as sub_plan
, coalesce(price, 0) as sub_price
FROM orgs
LEFT JOIN user_count on orgs.org_id = user_count.org_id
LEFT JOIN subscriptions on orgs.org_id = subscriptions.org_id
Loading