> For the complete documentation index, see [llms.txt](https://help.whaly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.whaly.io/recipes/sales/build-a-target-oriented-sales-dashboard.md).

# Build a target oriented sales dashboard

**Objectives**:&#x20;

As a sales manager, having a target oriented reporting strategy for your team is a driver of success.&#x20;

Objective tracking is a must-have tool that will animate your team and enable your teammate to deliver. It's a good start for starting sales gamification!

On a higher level, it will give you a good tool to drive your 1-to-1 meetings with your Sales rep and give you an easy way to identify which teammate requires coaching and on which topic.

If you follow this article, you will be able to build the following dashboard:

![](/files/T3soHeZJelz1mFcw1Il1)

## High level plan

* 🚛  Importing data into Whaly
  * Importing CRM data
  * Importing target data
* 🔗  Creating the relationships between the datasets
* 📆 Creating the exploration from Days
* 📈 Creating the charts
* ✨ Creating the dashboard

### 🚛  Importing data into Whaly

{% hint style="info" %}
On this article we'll use data from Airtable but the same pattern can be applied to any CRM such as [Hubspot](https://docs.whaly.io/sources/source-catalog/sales/hubspot), [Salesforce](https://docs.whaly.io/sources/source-catalog/sales/salesforce) and [Pipedrive](https://docs.whaly.io/sources/source-catalog/sales/pipedrive) 🤗
{% endhint %}

#### Importing CRM data

To get started, the first thing we are going to do is import our CRM data into Whaly. Our CRM data is composed of two tables.

One "deal" table containing information about our deals:&#x20;

![Our CRM "deal" table](/files/yVSdkyZLEiHpKUN25kbZ)

One "deal stage history" table containing information about our deals movements throughout our sales pipelines:&#x20;

![Our CRM "deal stage history" table](/files/lXBfKStPF2tz9GIIUuum)

#### Importing target data

The second type of data we are going to import is the targets. We will create monthly targets for our salespersons and structure our data with the following columns:

* **owner\_id**: the owner to whom the target applies
* **type**: the current objective (revenue, number of call done, ...)&#x20;
* **date**: the current objective date&#x20;
* **target**: the current target amount

{% hint style="info" %}
Targets should be written in a system on which you can easily input new data. We recommend to use either [Google Sheets](https://docs.whaly.io/sources/source-catalog/no-code/google-sheets) or [Airtable](https://docs.whaly.io/sources/source-catalog/no-code/airtable) for this task.
{% endhint %}

Let's take have a look at our example target database:&#x20;

![](/files/o3AKv7EXhCNHFXoZjZ28)

### 🔗 Creating the relationships between the datasets

Before creating our relationships, we need to ensure that our data will match. In our days table, the date is a timestamp at the beginning of the day (ex: `June 27 2022, 00:00:00`). In our deal stage history table, our timestamps have hours, minutes and seconds (ex: `February 17 2020, 17:39:02`). We will need to round our dates in our deal stage history table in order to have matching data for the relationship. Let's do it:

1. Open the workbench, go the your deal stage history view
2. Click on add a column, select formula, and use the cohort formula `day` as the type in order to round the date to the current day:

![](/files/coX8Lvy7xGmAE1LdWjKp)

As our targets and deals are going to be linked using our Days table, we will need to create relationships between:&#x20;

1. Days *has many* Targets&#x20;
2. Days *has many* Deal Stage History
3. Deal *has many* Deal Stage History

Let's get into the workbench, on the day table and create the following relationships:

![](/files/pKOjVD3gAwP5any9LFVa)

We will also need to create the relationship between our deals and deals stage history (this is optional is you are using Whaly native CRM connectors that auto create such relationships):&#x20;

![](/files/3GvAxayih69qGI0UMXCf)

### :telescope: Retrieve the missing columns in the deal stage history table

It's possible that your deal stage history table, that we will use our exploration, is missing some columns, such as our deal amount and our owner id. Fortunately we have this information in our deal table, so it's easy to bring them in the deal stage history table.&#x20;

Let's do it :&#x20;

1. Open the workbench, go the your deal stage history view
2. Click on add a column, select lookup, and fill the information as required:

![](/files/SvNmqJgFF7RfaACE0Sk5)

Now let's do the same thing for our amount column:

![](/files/sNiuSghq2CGEwnEK4fn7)

Now that we have all our data, we can start building our exploration.

### 📆  Creating the exploration from Days

Let's get to our workspace and create a new exploration, starting from our Days table. We do this in order to be able to add our "Deal Stage history" and "Targets" tables as related data.&#x20;

Let's do it:

1. Create a new exploration from `Days`
2. On the Days table:
   1. add `Date` as a dimension
   2. add `Deal stage history` as a related data
   3. add `Targets` as a related data
3. Remove all the metrics created automatically&#x20;

You should now have an exploration that looks like the following:

![](/files/5crdipa5z2sFR5KmxlwY)

Now we will create our metrics for targets and current progress.

Let's get started with the bookings target:&#x20;

1. Click on `Add a metric` under the `targets` table:&#x20;
2. Create a sum of the column `target`
3. Filter on all rows matching your desired `owner_id` and target type `revenue`
4. Give your custom metric a name, for example: `Target bookings (owner #0)`
5. Add a currency suffix to ensure our charts will look good
6. Create the metric

![](/files/Egy5qmHbFL9UowwA9FSq)

Now let's do the same for the current bookings of our `Owner #0`:

* Click on `Add a metric` under the `deal stage history` table:&#x20;
* Create a sum of the column `amount`
* Filter on all rows matching your desired `owner_id` and deal stage `closedwon`
* Give your custom metric a name, for example: `Bookings (owner #0)`
* Add a currency suffix to ensure our charts will look good
* Create the metric

{% hint style="info" %}
If the columns amount and owner\_id are missing from the deal stage history table you can easily add them using a lookup column in the workbench. See our guide here: <https://docs.whaly.io/data-management/workbench#2.-lookup>
{% endhint %}

![](/files/stKiXdqrU78xUBPhrTYQ)

We just have to repeat these steps for each of our owners and metrics that we want to follow. For example, with 2 owners and with revenue, Nb call done, Nb demo done, Nb trials done, we should build the following exploration:&#x20;

![](/files/6o1bpN6Pv380tpOxzHeF)

### 📆  Creating the charts

In order to create the charts, we will:

1. select the `Metric` chart type
2. add both our current KPI and target to our query builder, for example Bookings `(owner #0)` and `Target bookings (owner #0)`
3. add our `Date` dimension as the time field,
4. select a relevant time range
5. set `Gauge` as metric type
6. run the query

![](/files/4XKk61l1t7IP866Q3lmA)

### ✨ Creating the dashboard

We can repeat the previous step as many times as necessary in order to build our dashboard. For our example, with 4 KPIs and two different salespersons we can build the following report:&#x20;

![](/files/kPxn9JH4UDqNW1H7INQi)

And voilà, that's it :tada:


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.whaly.io/recipes/sales/build-a-target-oriented-sales-dashboard.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
