Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 3 additions & 3 deletions .github/workflows/dbt_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
- name: dbt deps
run: dbt deps

- name: Find Current Pull Request
uses: jwalton/gh-find-current-pr@v1.3.0
id: findPR
# - name: Find Current Pull Request
# uses: jwalton/gh-find-current-pr@v1.3.0
# id: findPR

# TODO: update for your unique S3 bucket name
# TODO: update your GitHub secrets to include AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
Expand Down
13 changes: 7 additions & 6 deletions models/core/dim_orgs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ WITH orgs AS (
--prod
SELECT
org_id
, MIN(event_timestamp) AS created_at
FROM {{ ref('signed_in') }}
GROUP BY 1
, org_name
, employee_range
, created_at
FROM {{ ref('org_created') }}

-- --dev
-- SELECT
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
, coalesce(price, 0) as sub_price
FROM {{ ref('subscription_created') }}
)

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