Create KPI Widget

In this tutorial, we will understand how KPI widget is created and how it functions.

We will display the current and target sales values in different countries accross the globe in order to do so.

To add KPI Widget in the dashboard, follow the steps below:-

  • Click on the Component icon from the top right corner menu, a list of the available component will open up as follows:



  • Click on Component Icon from the list of the component into the dashboard, a configuration box would open as follows:



  • Provide a name to your KPI widget against the Name textbox as shown in the figure.
  • Select your desired dataset from the dropdown menu. For this example, we will be working with Sales.cds dataset.
  • We will be keeping value as dynamic in order to obtain the values from the database. If the value is kept static, then user has to manually enter the value.
  • Select extendedPrice from the Select Coloumns list and Aggregator as Sum, Filter Coloumn as Country and Filter Value as USA.
  • By doing so, the user instructs the KPI widget to find the total of sales of products in USA.
  • The condition and condition value specfies what condition must be applied to the filter column in order to make comparison and what should be its value.
  • In our case, we will find the total sales of products whose extendedPrice is greater than 5000 in USA.
  • All these fields are specified as follows:-



  • Keep values of all other fields as shown in the figure.
  • Toggle Abbreviation (to keep format like 3.6M) and Comma Separators (to insert commas after every 3 0's from right) as shown in the figure to modify the value of KPI widget.
  • You can also add title as shown in the figure below:-



  • After making these changes, KPI widget will be displayed as follows:-



  • Now to specify USA target value, add another Aggregator by clicking on icon next to Aggregator and select it from dropdown menu.
  • This will open the following dialog box:-



  • Disable dynamic toggle in order to input static values for target as show in the figure above.
  • Leave everything else as before.
  • Change the title of second value as follows:-



  • After this, the KPI widget will be displayed as follows:-



  • In order to save your changes, click on the Save button located at the topmost right corner of the dashboard.
  • In the similar manner, you can compare current sales value and target to be achieved across different nations of the world as follows:-



In this manner, you can use KPI widget to compare the current sales of products and how much more sales need to be done in order to reach the target.