...
From the different Entities that we will be able to create, we will select the "Creation of a KPI Entity" one:
...
The platform allows you to generate KPIs easily. Within the platform's data-centric approach, the KPIs are ontologies and are generated by aggregating information that is stored in other ontologies.
Let's see an example showing how to create a KPI.
From the menu option DEVELOPMENT > My Ontologies, select CREATE:
In the next screen, select Creation KPI:
The creation screen asks for a Query. This input will be used to specify a query that will extract, group, transform and aggregate data from the ontology that serve as the basis for your KPI's creation. This query's result will be stored in the ontology that you will later select.
...
For this example, select the ontology Restaurants, including information on New York restaurants, their type of cuisine, position, etc.
...
Fill in general information
This will open the Entity creation wizard, where we will first have to indicate if we are going to generate a new Entity, or if we want to reuse an existing one.
If we are going to reuse a new Entity, we will uncheck the "New Entity" toggle switch, which will enable a selector where we will be able to search for the Entity we want to use.
...
In case a new Entity is going to be created, we will have to enter some basic information like the rest of the Entities.
...
Identification: the unique name with which to identify the Entity.
Meta-Information: tags to characterize the Entity, which will be used for filtering when searching.
Description: extended descriptive text of the Entity, such as its use, properties, characteristics, etc.
Database Instance: here you can indicate the type of database to be used for this Entity.
In addition, we have some more options to characterize the Entity:
Active: so that the Entity works or is blocked.
Public entity: if we want the Entity to be public, or if we want it to be private.
Allows encryption of fields: if we want some fields to store sensitive information and be encrypted (more information).
ContextData Enable: if you want the Entity to internally record write and management changes (more information).
nce the Entity's general information and options have been defined, click on the "Continue" button to access to the KPI configuration.
...
KPI configuration
In this screen, we must first define the Cron Job of the KPI, i.e. assign a periodicity of execution.
...
For this guide, we will indicate a daily periodicity, at 00:00:
...
We will also be able to select whether the generation of this KPI will be carried out within a specific period of dates (for example, if we are running a campaign and we are interested in generating the KPI only for a few specific days):
...
Next, below these temporary options, there is a code window where we will be able to enter a query, which will be used to indicate what data will be extracted, its grouping, transformation and aggregation of other Entities that serve as the basis for the creation of the KPI.
The result of this query will be what is stored in the Entity of type KPI that we are generating.
As an example, let's say that we are interested in knowing from the "Restaurants" Entity, the rating of the restaurants by type of cuisine food and borough, so your query will be:select neighborhood. So, we will generate the following query:
Code Block | ||
---|---|---|
| ||
SELECT c.Restaurant.cuisine as cuisine, c.Restaurant.borough as borough, sum(c.Restaurant.grades[0].score) as score |
...
FROM Restaurants as |
...
c GROUP BY c.Restaurant.cuisine,c.Restaurant.borough |
If you select it, you have:
...
Once you have the query (that allows you to use the NOW() function to establish time relationships such as, calculate last month's ratings),
use CRON's wiza4rd to assign an execution periodicity. In this case, say every day at 00:00:
...
You can also choose whether this KPI's generation will be made only between two dates or not (for instance, if you are working on a campaign and you want the KPI to be generated only during some specific days).
...
Finally, select whether you want to generate the KPI on a new ontology or on a pre-existing ontology (in case you generate several KPIs of different type on the same ontology):
...
In this case, select a new ontology and fill in the data:
...
After selecting Create, you can go back to the Ontology list, where you will see:
...
Here you can stop the task's execution:
...
Once the KPI has been created and the task is running, the execution is launched depending on the assigned temporality, and the query's resulting data are stored.we launch the query, the result we will obtain will be the following:
...
If we need to process the query information to adapt it in some way, we can activate the "Enable processing" toggle switch to enable a JavaScript code editing window, where we can modify the query result:
...
Once the query is as we need it, click on the "Create" button to finish the creation of the Entity.
...
A window will then be displayed with the available options to be performed with the Entity created.
...
Clicking on the "Close" button will take you back to the Entities list, where the newly created Entity will appear.
...
KPI Management
After creating the Entity, we will return to the Entity list where it will be listed, with its properties. There we will see that it is of type KPI:
...
The KPI Entity will be running according to the assigned temporality, storing the data obtained by the query we have defined.
In the entity options, we will be able to stop the execution of the task by clicking on the "Stop" option:
...
To reactivate the task, we can do it from the same menu by clicking on "Play":
...
In addition, we will be able to run the KPI at any time (to check that it is working, for example), by clicking on "Execute KPI":
...