Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions README.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also update the table description in the README to link to the docs page. Currently we link to the github file. See here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated both!

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ By default, this package materializes the following final tables:

| Table | Description |
| :---- | :---- |
| [zuora__account_daily_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_daily_overview) | Provides daily account snapshots with invoice counts, amounts, payments, taxes, discounts, refunds, and rolling totals to track account financial health, payment activity, and balance evolution over time. For an example of how this data can be used to evaluate churn at the monthly level, see [this analysis query](https://github.com/fivetran/dbt_zuora/blob/65f1aa666a214e6111e2879536e908d36e70f57f/analysis/zuora__account_churn_analysis.sql), and [see the DECISIONLOG](https://github.com/fivetran/dbt_zuora/blob/65f1aa666a214e6111e2879536e908d36e70f57f/DECISIONLOG.md#use-zuora__account_churn_analysis-in-our-analysis-folder-to-examine-churn-at-the-monthly-level) for a more detailed explanation of churn definitions and additonal evaluation grains. <br></br>**Example Analytics Questions:**<ul><li>How does rolling_invoice_amount_unpaid evolve day-by-day for each account?</li><li>What are the daily trends in daily_invoice_amount versus daily_invoice_amount_paid?</li><li>Which accounts have the highest rolling_invoices and rolling_refunds totals?</li></ul>|
| [zuora__account_daily_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_daily_overview) | Provides daily account snapshots with invoice counts, amounts, payments, taxes, discounts, refunds, and rolling totals to track account financial health, payment activity, and balance evolution over time. For an example of how this data can be used to evaluate churn at the monthly level, see [this analysis query](https://fivetran.github.io/dbt_zuora/#!/analysis/analysis.zuora.zuora__account_churn_analysis), and [see the DECISIONLOG](https://github.com/fivetran/dbt_zuora/blob/main/DECISIONLOG.md#use-zuora__account_churn_analysis-in-our-analysis-folder-to-examine-churn-at-the-monthly-level) for a more detailed explanation of churn definitions and additonal evaluation grains. <br></br>**Example Analytics Questions:**<ul><li>How does rolling_invoice_amount_unpaid evolve day-by-day for each account?</li><li>What are the daily trends in daily_invoice_amount versus daily_invoice_amount_paid?</li><li>Which accounts have the highest rolling_invoices and rolling_refunds totals?</li></ul>|
| [zuora__account_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_overview) | Consolidates account profiles with comprehensive transaction metrics including invoice counts, amounts, payments, subscriptions, taxes, discounts, refunds, and monthly averages to understand account financial performance and relationships. <br></br>**Example Analytics Questions:**<ul><li>Which accounts have the highest total_invoice_amount and active_subscription_count?</li><li>How do total_amount_paid versus total_amount_not_paid compare by account_status?</li><li>What is the monthly_average_invoice_amount and account_zuora_calculated_mrr by customer tenure (account_active_months)?</li></ul>|
| [zuora__billing_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__billing_history) | Tracks invoice-level billing history with amounts, payment details, charges, tax, discounts, refunds, credit adjustments, and product/subscription counts to analyze billing patterns, payment status, and revenue recognition timing. <br></br>**Example Analytics Questions:**<ul><li>What is the average invoice_amount and invoice_amount_unpaid by status and due_date aging?</li><li>How many invoice_items, products, and subscriptions are typically on each invoice?</li><li>What is the time between invoice_date and first_payment_date by account?</li></ul>|
| [zuora__line_item_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__line_item_history) | Chronicles individual invoice line items with product details, subscription info, charge amounts, discounts, taxes, service periods, and revenue calculations to provide granular visibility into revenue components and product-level billing. <br></br>**Example Analytics Questions:**<ul><li>Which products (product_id, sku) generate the highest gross_revenue and net_revenue?</li><li>How do charge_amount and discount_amount vary by charge_type and charge_model?</li><li>What is the charge_mrr distribution across subscriptions and rate plans?</li></ul>|
Expand All @@ -60,7 +60,7 @@ By default, this package materializes the following final tables:
---

## Visualizations
Many of the above reports are now configurable for [visualization via Streamlit](https://github.com/fivetran/streamlit_zuora). Check out some [sample reports here](https://fivetran-zuora.streamlit.app/).
Many of the above reports are now configurable for [visualization via Streamlit](https://github.com/fivetran/streamlit_fivetran_billing_model). Check out some [sample reports here](https://fivetran-billing-model.streamlit.app//).

<p align="center">
<a href="https://fivetran-billing-model.streamlit.app/">
Expand Down
22 changes: 22 additions & 0 deletions analyses/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Zuora Analysis
> Note: The compiled sql within the `analyses` folder references the final models [zuora__account_daily_overview](https://github.com/fivetran/dbt_zuora/blob/main/models/zuora__account_daily_overview.sql) and [zuora__line_item_history](https://github.com/fivetran/dbt_zuora/blob/main/models/zuora__line_item_history.sql). Before you can compile and use the analysis SQL, you'll must execute a `dbt run` first.


## Analysis SQL
| **sql** | **description** |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [zuora__account_churn_analysis](https://fivetran.github.io/dbt_zuora/#!/analysis/analysis.zuora.zuora__account_churn_analysis) | The output of the compiled sql will generate monthly account churn analysis by identifying when accounts transition from active to inactive status. The analysis provides insights into account retention patterns by tracking rate plan charges per account over time and flagging churned months when an account goes from having active charges to no active charges. The SQL references the `zuora__account_daily_overview` and `zuora__line_item_history` models and includes `source_relation` to support multi-connection setups. |

## SQL Compile Instructions
Leveraging the above sql is made possible by the [analysis functionality of dbt](https://docs.getdbt.com/docs/building-a-dbt-project/analyses/). In order to
compile the sql, you will 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/zuora/analyses` directory.
- Copy the desired analysis code (`zuora__account_churn_analysis`) and run in your data warehouse.
- Confirm the account churn metrics match your expected subscription patterns.
- Analyze the monthly churn data to identify trends and patterns in customer retention and account lifecycle management.

## Contributions
Don't see a compiled sql statement you would have liked to be included? 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_zuora/issues/new?template=feature-request.yml).
Empty file removed analysis/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

Loading