# Create KPI

The first step in KPI creation is deciding what data you will report, then create the SQL query to pull the data from the database.

![P4 Warehouse Widget List](/files/-Mj9AHsIMUY5eCsqj4TX)

In this screen you can edit an existing report, or you can create a new report.

{% hint style="info" %}
To create reports you will need to know TSQL, the best option is to download the database [backup ](/p4warehouse-english/setup/reports-and-kpi/database-backups.md)to create your SQL statement.
{% endhint %}

By clicking the name of an existing Widget, you will be able to edit the reports SQL statement.

![P4 Warehouse SQL reports Query](/files/-Mj9BL9Zd_crZY7V7oSu)

Once you have your SQL Query working you will need to add a Chart.

![](/files/-MjCWV-kDUOJSp--DwFh)

* In the chart settings set the Name to a name of your choice
* For Chart Type select the type of chart you need, Area, Bar, Column, Line or Pie
* Put the exact name of your column in the Argument Field and the Value Field.
* Put the name of your Series Column

{% hint style="danger" %}
KPI's are an in-depth subject; it is recommended you speak with your P4 Warehouse Partner to get more details.
{% endhint %}

![](/files/-MjCe3GIwnnTAIzzWi_g)


---

# Agent Instructions: 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:

```
GET https://docs.p4.software/p4warehouse-english/analytics-reporting/kpi/create-kpi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
