> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Custom Dashboard

<Badge icon="arrow-left" color="gray">[Back to Analytics Overview](/ai-for-service/analytics/overview)</Badge>

This page walks through creating a custom dashboard using a Banking AI Agent as an example to analyze performance metrics and identify trends.

## Problem Statement

As a Banking AI Agent client, you want to track the following metrics:

* Dollar Value Breakup
* Customer Type Summary
* Task Fulfillment Trend
* Top Failure Tasks
* Channel Volume Trend
* Filter the Messages using the Having clause

Once the dashboard is configured for all scenarios, it looks like the following:

<img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/configured-custom-dashboard.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=2556c45df187fb9edd8f46fc119181cc" alt="Configured Custom Dashboard" width="1216" height="666" data-path="ai-for-service/analytics/automation/custom-dashboard/images/configured-custom-dashboard.png" />

***

## Pre-requisites

* AI Agent building knowledge.
* Custom Meta Tags usage. See Custom Meta Tags for more information.
* A Banking AI Agent with the following dialog tasks:

**Transfer Funds**: A dialog task that walks the user through the transfer steps.

<img src="https://mintcdn.com/koreai/LLoSsfuiOXeOr3tU/ai-for-service/analytics/automation/custom-dashboard/images/transfer-funds.png?fit=max&auto=format&n=LLoSsfuiOXeOr3tU&q=85&s=5a5d4885e44ec1f91bb2bda166cd38b8" alt="Transfer Funds" width="1261" height="700" data-path="ai-for-service/analytics/automation/custom-dashboard/images/transfer-funds.png" />

This dialog includes a Script node to add the Custom Meta Tag `TransferValue` based on the amount transferred:

```javascript theme={null}
if(context.entities.TransferAmount[0].amount > 50000){
   tags.addSessionLevelTag("TransferValue", "HighValue");
}

if(context.entities.TransferAmount[0].amount > 10000)
tags.addSessionLevelTag("TransferValue","MediumValue");

if(context.entities.TransferAmount[0].amount > 0)
tags.addSessionLevelTag("TransferValue","LowValue");
```

<img src="https://mintcdn.com/koreai/LLoSsfuiOXeOr3tU/ai-for-service/analytics/automation/custom-dashboard/images/transfer-funds-add-scripts.png?fit=max&auto=format&n=LLoSsfuiOXeOr3tU&q=85&s=a0e56b7edc15ab861b44cb48908f1474" alt="Transfer Funds Add Scripts" width="546" height="430" data-path="ai-for-service/analytics/automation/custom-dashboard/images/transfer-funds-add-scripts.png" />

**Manage Payee**: A dialog task for the user to manage their payee list.

<img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/manage-payee.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=f849ff20daffc4ce4f7d2c97cae10118" alt="Manage Payee" width="1265" height="585" data-path="ai-for-service/analytics/automation/custom-dashboard/images/manage-payee.png" />

This dialog includes a Script that assigns a value to the `CustomerType` meta tag:

```javascript theme={null}
if(context.custType == 3){
   tags.addUserLevelTag("CustomerType","Premium");
}
if(context.custType == 2){
   tags.addUserLevelTag("CustomerType","Gold");
};
if(context.custType == 1){
   tags.addUserLevelTag("CustomerType","Regular");
};
```

***

## Implementation

1. From the left navigation panel, under **Dashboard**, click **Custom Dashboard**.

2. Click **Create a New Dashboard**.

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/create-new-dashboard.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=4c7cde75f349d2063e1ce10c4c842903" alt="Create New Dashboard" width="1791" height="750" data-path="ai-for-service/analytics/automation/custom-dashboard/images/create-new-dashboard.png" />

3. Use the **Add Widget** button to add widgets for each scenario. You can add up to 4 widgets per row and organize them by moving within or across rows. Widgets can also be manually resized.

The following sections explain the configuration for each widget.

***

### Dollar Value Breakup

1. Click **Add Widget**.

2. Query setup:
   * **Dataset**: Analytics
   * **Select**: `sessionTag.TransferValue as TransferValue, count(taskName)`
   * **Group By**: `sessionTag.TransferValue`
   * Click **Run** to see the results.

3. Widget setup:

   * Chart type: **Pie chart**
   * **Dimension**: `TransferValue`
   * **Metrics**: `count(taskName)`

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/dollar-value-breakup1.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=d553ec423d3b919970125ab5a01b7bdb" alt="Dollar Value Breakup Query" width="1269" height="697" data-path="ai-for-service/analytics/automation/custom-dashboard/images/dollar-value-breakup1.png" />

4. Click **Preview**, then click **Update to Dashboard**.

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/dollar-value-breakup2.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=2f5a9e3b0a83c3941591404a4ed33c8d" alt="Dollar Value Breakup Preview" width="1269" height="696" data-path="ai-for-service/analytics/automation/custom-dashboard/images/dollar-value-breakup2.png" />

***

### Customer Type Summary

This query provides usage statistics based on customer type.

1. Click **Add Widget**.

2. Query setup:
   * **Dataset**: Analytics
   * **Select**: `userTag.CustomerType as CustomerCategory, count(taskName)`
   * **Group By**: `userTag.CustomerType`
   * Click **Run** to see the results.

3. Widget setup:

   * Chart type: **Bar chart**
   * **Dimension**: `CustomerCategory`
   * **Metrics**: `count(taskName)`

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/customer-type-summary.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=27b8183bb890f28d993e3a9358a630fb" alt="Customer Type Summary" width="1268" height="692" data-path="ai-for-service/analytics/automation/custom-dashboard/images/customer-type-summary.png" />

4. Click **Preview**, then click **Update to Dashboard**.

***

### Task Fulfillment Trend

This query provides day-wise task success vs. failure trends.

1. Click **Add Widget**.

2. Query setup:
   * **Dataset**: Analytics
   * **Select**: `date, metricType, count(metricType) as TotalTasks`
   * **Filter By**: `metricType = 'successtasks' or metricType = 'failedtasks'`
   * **Group By**: `date, metricType`
   * Click **Run** to see the results.

3. Widget setup:

   * Chart type: **Bar chart**
   * **Dimension**: `date`
   * **Metrics**: `TotalTasks`
   * **Overlay**: `metricType`

   <img src="https://mintcdn.com/koreai/LLoSsfuiOXeOr3tU/ai-for-service/analytics/automation/custom-dashboard/images/task-fulfillment-trend.png?fit=max&auto=format&n=LLoSsfuiOXeOr3tU&q=85&s=a74b02fb314ad5615c5c774a0d0f9e5e" alt="Task Fulfillment Trend" width="1269" height="705" data-path="ai-for-service/analytics/automation/custom-dashboard/images/task-fulfillment-trend.png" />

4. Click **Preview**, then click **Update to Dashboard**.

***

### Top Failure Tasks

This query shows the top tasks that are failing.

1. Click **Add Widget**.

2. Query setup:
   * **Dataset**: Analytics
   * **Select**: `taskName as TaskName, count(taskName) as Failures`
   * **Filter By**: `metricType = 'failedtasks'`
   * **Group By**: `taskName`
   * Click **Run** to see the results.

3. Widget setup:

   * Chart type: **Table chart**
   * **Dimension**: `TaskName` and `Failures`

   <img src="https://mintcdn.com/koreai/LLoSsfuiOXeOr3tU/ai-for-service/analytics/automation/custom-dashboard/images/top-failure-tasks.png?fit=max&auto=format&n=LLoSsfuiOXeOr3tU&q=85&s=0e537ca7a9200220c78e3311f6438b68" alt="Top Failure Tasks" width="1269" height="704" data-path="ai-for-service/analytics/automation/custom-dashboard/images/top-failure-tasks.png" />

4. Click **Preview**, then click **Update to Dashboard**.

***

### Channel Volume Trend

This query provides channel-wise usage details.

1. Click **Add Widget**.

2. Query setup:
   * **Dataset**: Messages
   * **Select**: `date, channel, count(messageId)`
   * **Group By**: `date, channel`
   * Click **Run** to see the results.

3. Widget setup:

   * Chart type: **Line chart**
   * **Dimension**: `date`
   * **Metrics**: `count(messageId)`
   * **Overlay**: `channel`

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/channel-volume-trend.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=e0a92a49ea68dcee7f1ffb18f59b6945" alt="Channel Volume Trend" width="1265" height="710" data-path="ai-for-service/analytics/automation/custom-dashboard/images/channel-volume-trend.png" />

4. Click **Preview**, then click **Update to Dashboard**.

Your custom dashboard is ready. Set the **Date Range** to view the required metrics for each scenario.

***

### Filter the Messages using the Having Clause

This query uses a **Having** clause to display the number of messages per userId where the user has interacted with the AI Agent more than 12 times.

1. Click **Add Widget**.

2. Query setup:
   * **Dataset**: Messages
   * **Select**: `count(messageId), userId`
   * **Group By**: `userId`
   * **Having**: `count(messageId) > 12`
   * Click **Run** to see the results.

3. Widget setup:
   * Chart type: **Table chart**
   * **Dimension**: `count(messageId)`, `userId`

4. The following shows results when retrieving the count of all messages grouped by userId (without the Having clause):

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause1.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=8e1018050701908db09dc666f95c73dc" alt="Filter Messages Having Clause 1" width="906" height="704" data-path="ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause1.png" />

5. The following shows results when using the Having clause (only users with more than 12 messages):

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause2.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=72ca6b1b25b1729713d3d6d31d10c843" alt="Filter Messages Having Clause 2" width="1421" height="711" data-path="ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause2.png" />

6. Click **Preview**, then click **Add to Dashboard**.

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause3.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=8b9ac58292e2468db40c4a94a1bd6dda" alt="Filter Messages Having Clause Preview" width="1542" height="710" data-path="ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause3.png" />

7. The Having clause widget is added to the dashboard:

   <img src="https://mintcdn.com/koreai/SCUgmjx-8gufOh9O/ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause4.png?fit=max&auto=format&n=SCUgmjx-8gufOh9O&q=85&s=17d1586c97ca4d50a3c7b3652c0342bf" alt="Filter Messages Having Clause Dashboard" width="1868" height="473" data-path="ai-for-service/analytics/automation/custom-dashboard/images/filter-the-message-using-having-clause4.png" />
