Skip to content

Commit

Permalink
Merge pull request #5 from fivetran/5tran-alexil-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
fivetran-joemarkiewicz authored Aug 3, 2023
2 parents 032b3f8 + 2f038f5 commit 76cd103
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
# Zuora dbt package ([Docs](https://fivetran.github.io/dbt_zuora/))

# 📣 What does this dbt package do?
- Produces modeled tables that leverage Zuora data from [Fivetran's connector](https://fivetran.com/docs/applications/zuora) in the format described by [this ERD](https://fivetran.com/docs/applications/zuora#schemainformation) and build off the output of our [Zuora source package](https://github.com/fivetran/dbt_zuora_source).
- Produces modeled tables that leverage Zuora data from [Fivetran's connector](https://fivetran.com/docs/applications/zuora) in the format described by [this ERD](https://fivetran.com/docs/applications/zuora#schemainformation) and builds off the output of our [Zuora source package](https://github.com/fivetran/dbt_zuora_source).

- Enables you to better understand your Zuora data. The package achieves this by performing the following:
- Enhance the balance transaction entries with useful fields from related tables.
- Create customized analysis tables to examine churn by subscriptions.
- Developed a look at gross, net and discount monthly recurring revenue by account.
- Generate a metrics tables allow you to better understand your account activity over time or at a customer level. These time-based metrics are available on a daily level.
- Enhancing the balance transaction entries with useful fields from related tables
- Creating customized analysis tables to examine churn by subscriptions
- Developing a look at gross, net, and discount monthly recurring revenue by account
- Generating metrics tables that allow you to better understand your account activity over time or at a customer level. These time-based metrics are available on a daily level.
- Generates a comprehensive data dictionary of your source and modeled Zuora data through the [dbt docs site](https://fivetran.github.io/dbt_zuora/).

The following table provides a detailed list of all models materialized within this package by default.
> TIP: See more details about these models in the package's [dbt docs site](https://fivetran.github.io/dbt_zuora/#!/overview?g_v=1).
| **model** | **description** |
| **model** | **description** |
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [zuora__account_daily_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_daily_overview) | Each record is a day in an account and its accumulated balance totals based on all line item transactions up to that day. |
| [zuora__account_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_overview) | Each record represents an account, enriched with metrics about their associated transactions. |
| [zuora__billing_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__billing_history) | Each record represents an invoice and its various transaction details. |
| [zuora__line_item_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__line_item_history) | Each record represents a specific invoice item and its various transaction details. |
| [zuora_account_daily_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_daily_overview) | Each record is a day in an account and its accumulated balance totals based on all line item transactions up to that day. |
| [zuora_account_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__account_overview) | Each record represents an account, enriched with metrics about their associated transactions. |
| [zuora_billing_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__billing_history) | Each record represents an invoice and its various transaction details. |
| [zuora_line_item_history](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__line_item_history) | Each record represents a specific invoice item and its various transaction details. |
| [zuora__monthly_recurring_revenue](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__monthly_recurring_revenue) | Each record represents an account and MRR generated on a monthly basis. |
| [zuora__subscription_overview](https://fivetran.github.io/dbt_zuora/#!/model/model.zuora.zuora__subscription_overview) | Each record represents a subscription, enriched with metrics about time, revenue, state, and period.

Expand All @@ -42,11 +42,11 @@ An example churn model is separately available in the analysis folder:
# 🎯 How do I use the dbt package?
## Step 1: Prerequisites
To use this dbt package, you must have the following:
- At least one Fivetran Zuora connector syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, **Databricks** destination.
- At least one Fivetran Zuora connector syncing data into your destination
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, **Databricks** destination

### Databricks Dispatch Configuration
If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your `dbt_project.yml`. This is required for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively.
If you are using a Databricks destination with this package, you will need to add the below (or a variation of the below) dispatch configuration within your `dbt_project.yml`. This is required for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages, respectively.

```yml
dispatch:
Expand All @@ -66,7 +66,7 @@ Do NOT include the `zuora_source` package in this file. The transformation packa


## Step 3: Define database and schema variables
By default, this package runs using your destination and the `zuora` schema. If this is not where your zuora data is (for example, if your zuora schema is named `zuora_fivetran`), add the following configuration to your root `dbt_project.yml` file:
By default, this package runs using your destination and the `zuora` schema. If this is not where your Zuora data is (for example, if your Zuora schema is named `zuora_fivetran`), add the following configuration to your root `dbt_project.yml` file:

```yml
vars:
Expand All @@ -75,7 +75,7 @@ vars:
```

## Step 4: Disable models for non-existent sources
Your Zuora connector may not be syncing all tabes that this package references. This might be because you are excluding those tables. If you are not using those tables, you can disable the corresponding functionality in the package by specifying the variable in your dbt_project.yml. By default, all packages are assumed to be true. You only have to add variables for tables you want to disable, like so:
Your Zuora connector may not be syncing all tabes that this package references. This might be because you are excluding those tables. If you are not using those tables, you can disable the corresponding functionality in the package by specifying the variable in your dbt_project.yml. By default, all packages are assumed to be true. You only have to add variables for tables you want to disable in the following way:

```yml
vars:
Expand All @@ -85,15 +85,15 @@ vars:
zuora__using_taxation_item: false # Disable if you do not have the taxation item table
```

## Step 5: Configure the multicurrency variable for customers billing in multiple currencies.
Zuora allows the functionality for multicurrency to bill to customers in various currencies. If you are an account utilizing multicurrency, make sure to set the `zuora__using_multicurrency` variable to true in dbt_project.yml so the amounts in our data models accurately reflect the home currency values in your native account currency.
## Step 5: Configure the multicurrency variable for customers billing in multiple currencies
Zuora allows the functionality for multicurrency to bill customers in various currencies. If you are an account utilizing multicurrency, make sure to set the `zuora__using_multicurrency` variable to `true` in `dbt_project.yml` so the amounts in our data models accurately reflect the home currency values in your native account currency.

```yml
vars:
zuora__using_multicurrency: false #Enable if you are utilizing multicurrency, false by default.
```
### Multicurrency Support Disclaimer (and how you can help)
We were not able to develop the package using the multicurrency variable, so we had to execute best judgement when building these models. If you encounter any issues with enabling the variable, [please file a bug report with us](https://github.com/fivetran/dbt_zuora/issues/new?assignees=&labels=type%3Abug&template=bug-report.yml&title=%5BBug%5D+%3Ctitle%3E) and we can work together to fix any issues you encounter!
We were not able to develop the package using the multicurrency variable, so we had to execute our best judgement when building these models. If you encounter any issues with enabling the variable, [please file a bug report with us](https://github.com/fivetran/dbt_zuora/issues/new?assignees=&labels=type%3Abug&template=bug-report.yml&title=%5BBug%5D+%3Ctitle%3E) and we can work together to fix any issues you encounter!

## (Optional) Step 6: Additional configurations
<details><summary>Expand to view configurations</summary>
Expand All @@ -113,7 +113,7 @@ vars:
```

### Passing Through Additional Fields
This package includes all source columns defined in the [macros folder of the dbt_zuora_source package](https://github.com/fivetran/dbt_zuora_source/tree/main/macros). You can add more columns using our pass-through column variables. These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables:
This package includes all source columns defined in the [macros folder of the dbt_zuora_source package](https://github.com/fivetran/dbt_zuora_source/tree/main/macros). You can add more columns using our pass-through column variables. These variables allow the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a SQL snippet within the `transform_sql` key. You may add the desired SQL while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables:

```yml
vars:
Expand All @@ -133,7 +133,7 @@ vars:
alias: "coolest_field_name"
```
### Change the build schema
By default this package will build the Zuora staging models within a schema titled (<target_schema> + `_stg_zuora`), the Zuora intermediate models within a schema titled (<target_schema> + `_zuora_int`) and the Zuora final models within a schema titled (<target_schema> + `_zuora`) in your target database. If this is not where you would like your modeled Zuora data to be written to, add the following configuration to your `dbt_project.yml` file:
By default this, package will build the Zuora staging models within a schema titled (<target_schema> + `_stg_zuora`), the Zuora intermediate models within a schema titled (<target_schema> + `_zuora_int`), and the Zuora final models within a schema titled (<target_schema> + `_zuora`) in your target database. If this is not where you would like your modeled Zuora data to be written to, add the following configuration to your `dbt_project.yml` file:

```yml
models:
Expand Down Expand Up @@ -192,8 +192,8 @@ We highly encourage and welcome contributions to this package. Check out [this d

## Opinionated Modelling Decisions
This dbt package takes several opinionated stances in order to provide the customer several options to better understand key subscription metrics. Those include:
- Evaluating a history of billing transactions, examined at either the invoice or invoice item level.
- How to calculate monthly recurring revenue and at which grains to assess it, either looking at it granularly at the charge (invoice item) or account monthly level.
- Evaluating a history of billing transactions, examined at either the invoice or invoice item level
- How to calculate monthly recurring revenue and at which grains to assess it, either looking at it granularly at the charge (invoice item) or account monthly level
- Developing a custom churn analysis that you can find in the analysis folder that's built on the account monthly level, but also giving the customer the ability to look at churn from a subscription or rate plan charge level.

If you would like a deeper explanation of the decisions we made to our models in this dbt package, you may reference the [DECISIONLOG](https://github.com/fivetran/dbt_zuora/blob/main/DECISIONLOG.md).
Expand Down

0 comments on commit 76cd103

Please sign in to comment.