Total Amount (Shop Money) by Source [Shopify]

Follow the Metric Recipe below to create the metric Total Amount (Shop Money) by Source from Shopify.

1. Configure the dataset

If you already have an existing dataset, ensure that you have the following views and columns included. Read more about how to create a dataset.

a) Include these columns in the Sales Dataset

Data Source

Views

Columns

Shopify

Sales

SalesAgreementId

Id

LineType

TotalAmount_ShopMoney_Amount


b) Include these columns in the Orders Dataset

Data Source

Views

Columns

Shopify

Orders

Id

SourceName

Test

ProcessedAt


c) Include these columns in the Sales Agreement Dataset

Data Source

Views

Columns

Shopify

Sales Agreements

Id

OrderId

HappenedAt


d) Merge Datasets together

First merge Sales with Sales Agreements:

Dataset

Column to join

Operator

Sales

SalesAgreementId

Left Outer Join

Sales Agreement

Id


Then merge the result with Orders:

Dataset

Column to join

Operator

Sales Agreement

OrderId

Left Outer Join

Orders

Id



2. Create the Custom Metric

Navigate to Metric Builder and create a new Custom Metric by selecting the merged dataset created in the previous step. Read more about how to create a custom metric.

Field

Value

Measure

TotalAmount_ShopMoney_Amount

Date

HappenedAt

Dimension

SourceName

Aggregation

SUM

Filters

LineType โ‰  GIFT_CARD

Test = 0

Check out the Schema Explorer to learn more about all supported views and columns/properties: https://schema-explorer.databox.com/?integrationkey=Shopify