-
Notifications
You must be signed in to change notification settings - Fork 40
Feature/stripe mrr arr models #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 32 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
528f205
feature/stripe-mrr-arr-models
fivetran-savage 8cfb74e
add_price_plan_seed_data
fivetran-savage 00f748e
Update PR reference in CHANGELOG.md
fivetran-savage 0e5ff19
update_price_seed_data
fivetran-savage bcd3252
update CHANGELOG
fivetran-savage 4cf6395
dbt bump to v3.0.0 (#137)
fivetran-data-model-bot 9d4b6b6
continue rebase - resolve conflict
fivetran-savage 2077707
Update PR reference in CHANGELOG.md
fivetran-savage 5e3efc4
add-arr-to-analysis-folder
fivetran-savage 70d297a
update_folder_name
fivetran-savage ef514e9
Merge branch 'main' into feature/stripe-mrr-arr-models
fivetran-savage 765788a
update-project-yml
fivetran-savage 92904e6
add_config_to_analyses
fivetran-savage 23cd46e
update_changelog
fivetran-savage 577afa5
prerelease_update
fivetran-savage 6f66adf
add_new_model_to_quickstart
fivetran-savage 2f8af64
Generate dbt docs via GitHub Actions
github-actions[bot] df0172d
add_docs
fivetran-savage d6c16d9
remove_date_spine_dependency
fivetran-savage ee817d0
Update Stripe package version to 1.3.0-a4
fivetran-savage 7485ed4
add_cross_join_to_date_spine
fivetran-savage 6343924
Generate dbt docs via GitHub Actions
github-actions[bot] f5e512d
add_weekly_subscription_logic
fivetran-savage 0aec95a
add_price_plan_grain_to_mrr
fivetran-savage e92da7b
add_coupon_and_int_discount_model
fivetran-savage 6ae933e
correct_version
fivetran-savage 4fab22e
Merge remote-tracking branch 'origin/main' into feature/stripe-mrr-ar…
fivetran-savage a37a417
Cast recurring_interval_count to integer type
fivetran-savage ba77519
cast discount_amount as dbt.type_numeric
fivetran-savage aa21685
Fix discount_amount cast
fivetran-savage 7944982
update_version
fivetran-savage 1d3e7c2
incorporate_review_suggestions
fivetran-savage 60046da
Add 'coupon' feature to disable models section
fivetran-savage 9821457
update_changelog
fivetran-savage 0800ac1
remove_subscription_variable_from_subscription_item
fivetran-savage eb640c7
fix_variable_config_placement
fivetran-savage 1505af4
Generate dbt docs via GitHub Actions
github-actions[bot] d666c43
update_changelog
fivetran-savage 24be7b2
Incorporate review suggestions
fivetran-savage 024b26a
Update CHANGELOG.md
fivetran-savage fabb267
Update CHANGELOG.md
fivetran-savage 060bdf4
Update CHANGELOG
fivetran-savage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
fivetran-savage marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ## Stripe MRR Weekly Subscription Logic | ||
|
|
||
| We were unable to validate MRR numbers for weekly subscriptions with live data, but because Stripe does allow for weekly subscriptions, that level of granularity is included in the MRR calculation logic. If you notice any issues, please open a [github issue](https://github.com/fivetran/dbt_stripe/issues) and we will work with you to solve it. | ||
|
|
||
| ## Stripe MRR Reactivation Definition | ||
| MRR type is defined as a reactivation only after a subscription item has at least three months of history. This helps distinguish true reactivations from short-term billing gaps, proration effects, or delayed subscription starts that are common in Stripe data. A three-month threshold reflects common SaaS analytics practice and provides a conservative, stable definition of reactivation without introducing additional configuration complexity. However, we understand that this definition may not be the right one for every user of this package and we'd love to collaborate with you. Please open up a [feature request](https://github.com/fivetran/dbt_stripe/issues/new?template=feature-request.yml) if you have ideas or suggestions as to how this should be defined. |
|
fivetran-savage marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Stripe Analyses | ||
| > Note: The compiled SQL within the analyses folder references the [stripe__subscription_item_mrr_report](https://github.com/fivetran/dbt_stripe/blob/master/models/stripe_financial_reports/stripe__subscription_item_mrr_report.sql) model. You must execute `dbt run` before compiling the analysis SQL. | ||
|
|
||
|
|
||
| ## Analysis SQL | ||
| | **SQL** | **Description** | | ||
| | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | [stripe__arr_snapshot_analysis](https://github.com/fivetran/dbt_stripe/blob/master/analyses/stripe__arr_snapshot_analysis.sql) | This analysis generates a high-level ARR snapshot report for your business that you can use for revenue forecasting. The analysis provides year-end ARR metrics by aggregating MRR data from the last month of each calendar year and multiplying by 12. The SQL references the `stripe__subscription_item_mrr_report` model and aggregates metrics by currency. Subscriptions must be enabled for this report to compile correctly. | | ||
| | [stripe__customer_mrr_analysis](https://github.com/fivetran/dbt_stripe/blob/master/analyses/stripe__customer_mrr_analysis.sql) | This analysis generates an MRR report at the customer level that you can use for retention reporting and cohort analysis. The analysis aggregates monthly recurring revenue by customer and month, providing insights into customer-level revenue trends over time. The SQL references the `stripe__subscription_item_mrr_report` model. You can also generate this report at the overall business level by removing the customer_id field from the aggregation. | | ||
|
|
||
| ## SQL Compile Instructions | ||
| You can leverage the above SQL using the [analysis functionality of dbt](https://docs.getdbt.com/docs/building-a-dbt-project/analyses/). To compile the SQL, perform the following steps: | ||
| - Execute `dbt run` to create the package models. | ||
| - Execute `dbt compile` to generate the target-specific SQL. | ||
| - Navigate to your project's `/target/compiled/stripe/analyses` directory. | ||
| - Copy the desired analysis code (`stripe__arr_snapshot_analysis` or `stripe__customer_mrr_analysis`) and run it in your data warehouse. | ||
| - Confirm the revenue metrics match your expected subscription and billing patterns. | ||
| - Analyze the ARR snapshots and customer-level MRR trends to identify growth opportunities, retention patterns, and revenue forecasting insights. | ||
|
|
||
| ## Contributions | ||
| Don't see a compiled SQL statement you'd like to include? Notice any bugs when compiling and running the analysis SQL? If so, we highly encourage and welcome contributions to this package! If interested, the best first step is [opening a feature request](https://github.com/fivetran/dbt_stripe/issues/new?template=feature-request.yml). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.