# Use Case: Display Net sales On a Dashboard by Subtracting Ad spend from Total Sales

### Begin by creating a workflow

Set up a new Workflow and name it 'Sales after Ad Spend'

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FOfwM457yJGGjeEXxZpIX%2Funnamed%20(4).png?alt=media&#x26;token=63e40a81-087b-452f-8574-bcb8ad247c75" alt="" width="375"><figcaption></figcaption></figure>

### Aggregate Ad Spend across Ad Networks <br>

Start with summing up the Ad Spend from all advertising networks. For the first network, Facebook, use the "Pull Data" building block.&#x20;

In this block, specify the integration name, select the business accounts (option to select all), and rename the building block to 'raw\_facebook.'

<br>

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FypZvQGOIX9Y9ypUGlDAp%2Funnamed%20(3).png?alt=media&#x26;token=683bf806-2405-49a1-b3c3-64c1f8c68597" alt=""><figcaption></figcaption></figure>

#### Focus on Ad Spend Only

Since we are interested only in the total ad spend, use the "Create Report" building block and rename it to "total\_facebook."<br>

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FO6SvO94d8bNjIE9PMfUP%2Funnamed%20(5).png?alt=media&#x26;token=60975442-d6f5-4cdc-817d-4e15e703bb4f" alt=""><figcaption></figcaption></figure>

To remove all dimensions, open the breakdown list and click "Clear all," leaving the dimensions list empty.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FcubnZ2RHAZPTUyUYEiRh%2Funnamed%20(6).png?alt=media&#x26;token=693c898b-6afa-40e3-9592-9736baac265d" alt=""><figcaption></figcaption></figure>

Then, select the 'Spend' metric

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FZvnPU7miXgra92hs9qvh%2Funnamed%20(7).png?alt=media&#x26;token=1bcf473c-13e9-44ea-9d97-7dca349e3384" alt=""><figcaption></figcaption></figure>

And, review the results

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FEcm7zrYmzknsXtOFQ9TW%2Funnamed%20(8).png?alt=media&#x26;token=c03e655f-252b-4bed-959e-27a521f7a431" alt=""><figcaption></figcaption></figure>

Here is what we should see, as our spend:

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FMCrKPA5lrBHPfXZaHOwB%2Funnamed%20(9).png?alt=media&#x26;token=5d49dbe9-25f7-4a78-9b3e-60ef550ecebd" alt="" width="352"><figcaption></figcaption></figure>

#### Repeat for Additional Networks

For each advertising network, add a "Pull Data" block and strip all dimensions to leave a single line indicating the total ad spend.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FlSZZahY7OzxykN49yAyt%2Funnamed%20(10).png?alt=media&#x26;token=63079fad-20af-42df-bafa-581c6420981d" alt=""><figcaption></figcaption></figure>

#### Combine Ad Spend Data

To consolidate the ad spend across networks, use the "Union" building block, renaming it "total\_adspend." Ensure this union includes only the datasets with dimensions removed.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FUPmdx4aVXNqYZivSvtBs%2Funnamed%20(11).png?alt=media&#x26;token=c97e88e3-d930-43ba-8f47-d2e1558471e8" alt=""><figcaption></figcaption></figure>

### Incorporate Sales Data

Pull the sales data using another "Pull Data" building block and remove all dimensions here as well.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FSVE0vpwO7HALTkzL3edM%2Funnamed%20(12).png?alt=media&#x26;token=816f64ea-d63c-4ca8-b387-1c3ba1fc8fd6" alt=""><figcaption></figcaption></figure>

### Merge Ad Spend and Sales Data

Combine the Ad Spend and Sales data into a single dataset using an additional "Union" building block.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2Fs1xQFPMIqPLfrNsaC8Hb%2Funnamed%20(13).png?alt=media&#x26;token=426d1b22-7d77-45aa-9ad3-bba565ab5f9e" alt=""><figcaption></figcaption></figure>

\
\
The resulting dataset should have two columns.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FAIbLLzLvPfNkjkDEPNUL%2Funnamed%20(14).png?alt=media&#x26;token=7bc30199-8b8c-45c3-a3f2-860833bd8f2a" alt="" width="375"><figcaption></figcaption></figure>

### Create Net Sales Metric

\
Use another "Create Report" building block, named "Sales after Ad Spend," to derive the net sales metric.&#x20;

Include the "Add Metric" child building block to define the metric name, type, and formula using the previously created columns.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FiWycH6jCD8rHlyxA3LFl%2Funnamed%20(12).png?alt=media&#x26;token=bf88427a-48b3-4782-975d-b5147d42f470" alt=""><figcaption></figcaption></figure>

### View and Validate the Result

Click the "View" button to confirm that the dataset now includes the required metric.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FHR6U0SBeKciaVPDY0BC6%2Funnamed%20(15).png?alt=media&#x26;token=4577c011-1534-44d6-897f-154292c2b556" alt=""><figcaption></figcaption></figure>

### Display the KPIs on a new Dashboard

1. Open the dashboard screen.
2. Create a new dashboard
3. Select the Workflow created earlier.
4. Specify the dataset within the workflow that contains all three metrics.
5. Click "Create" to finalize the dashboard setup.

<figure><img src="https://2311731864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWkzjcMtcJloeTqt0wsJi%2Fuploads%2FIoOZIcvvNmkn6fF4ttw1%2Funnamed%20(16).png?alt=media&#x26;token=20c17d0f-2f63-42e1-88e2-3ee06c8e7636" alt=""><figcaption></figcaption></figure>

<br>
