# KPI Creation

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](https://2764542787-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdqvtgkbuySRnxUkZY_%2F-Mj9A1g7QRPIEtjIUKAO%2F-Mj9AHsIMUY5eCsqj4TX%2Fimage.png?alt=media\&token=83054e9c-0305-4fad-ac5f-8f1a45a5b39f)

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 ](https://docs.p4.software/p4warehouse-english/setup/reports-and-kpi/database-backups)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 Querry](https://2764542787-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdqvtgkbuySRnxUkZY_%2F-Mj9AsaFdvGdtazpH09H%2F-Mj9BL9Zd_crZY7V7oSu%2Fimage.png?alt=media\&token=93808f99-3de0-4560-a396-a6ec3f47d011)

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

![](https://2764542787-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdqvtgkbuySRnxUkZY_%2F-MjAVDq-YEbi0Dj48ye1%2F-MjCWV-kDUOJSp--DwFh%2Fimage.png?alt=media\&token=5bbdf1a2-4a0e-43d8-aebd-53adcdc08c71)

* 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 %}

![](https://2764542787-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MdqvtgkbuySRnxUkZY_%2F-MjCdtJQxfwanWsr10F9%2F-MjCe3GIwnnTAIzzWi_g%2Fimage.png?alt=media\&token=4b494d3a-c9d1-4627-be97-3856b1a2328d)
