Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-catfritz committed Jan 17, 2024
2 parents ea121f1 + 0469a1e commit 9fe40f0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .quickstart/quickstart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
database_key: salesforce_marketing_cloud_database
schema_key: salesforce_marketing_cloud_schema

dbt_versions: ">=1.3.0 <2.0.0"

table_variables:
salesforce_marketing_cloud__link_enabled:
- link_send
- link
salesforce_marketing_cloud__list_enabled:
- list_subscriber
- list

destination_configurations:
databricks:
dispatch:
- macro_namespace: dbt_utils
search_order: [ 'spark_utils', 'dbt_utils' ]
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
This package models Salesforce Marketing Cloud data from [Fivetran's connector](https://fivetran.com/docs/applications/salesforce_marketing_cloud). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/salesforce_marketing_cloud#schemainformation).

The main focus of the package is to transform the core object tables into analytics-ready models:
<!--section="salesforce_marketing_cloud_model"-->
- Materializes [Salesforce Marketing Cloud staging tables](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/overview/salesforce_marketing_cloud_source/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/salesforce_marketing_cloud/#schemainformation). The staging tables clean, test, and prepare your Salesforce Marketing Cloud data from [Fivetran's connector](https://fivetran.com/docs/applications/salesforce_marketing_cloud_source) for analysis by doing the following:
- Materializes [Salesforce Marketing Cloud staging tables](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/overview/salesforce_marketing_cloud/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/salesforce_marketing_cloud/#schemainformation). The staging tables clean, test, and prepare your Salesforce Marketing Cloud data from [Fivetran's connector](https://fivetran.com/docs/applications/salesforce_marketing_cloud) for analysis by doing the following:
- Primary keys are renamed from `id` to `<table name>_id`.
- Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
- Provides insight into your Salesforce Marketing Cloud data across the following grains:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following table provides a detailed list of all models materialized within t
| **model** | **description**|
| --------- | -------------- |
| [salesforce_marketing_cloud__email_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__email_overview) | Each record provides the performance of an email via `total_*` and `*_rate` metrics. |
| [salesforce_marketing_cloud__events_enhanced](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__event_enhanced) | Each record expands the source events information by pivoting the `event_type` options into boolean fields. Each record also has related send and email information added. |
| [salesforce_marketing_cloud__events_enhanced](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__events_enhanced) | Each record expands the source events information by pivoting the `event_type` options into boolean fields. Each record also has related send and email information added. |
| [salesforce_marketing_cloud__sends_links](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_links) | Each record provides a link, joined with all corresponding send(s). |
| [salesforce_marketing_cloud__sends_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_overview) | Each record provides the performance of a send via `total_*` and `*_rate` metrics. |
| [salesforce_marketing_cloud__subscriber_lists](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__subscriber_lists) | Each record provides a list, joined with all corresponding subscriber(s). |
Expand Down
2 changes: 1 addition & 1 deletion models/salesforce_marketing_cloud__subscriber_overview.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with subscribers as (
case when subscribers.unsubscribed_date is not null
then {{ dbt.datediff("subscribers.created_date", "subscribers.unsubscribed_date", "day") }}
else {{ dbt.datediff("subscribers.created_date", "current_date", "day") }}
end as days_subscribed,
end as days_subscribed,
sum(case when events_enhanced.is_sent then 1 else 0 end) as number_of_sends,
max(case when events_enhanced.is_sent then events_enhanced.event_date end) as most_recent_send,
sum(case when events_enhanced.is_open then 1 else 0 end) as number_of_opens,
Expand Down

0 comments on commit 9fe40f0

Please sign in to comment.