Navigation:  Analysis panel >

Configuring a calculated field

Previous  Top  Next

The Calculated field functionality is present in the Analysis and OLAP records and is intended to create an additional field based on the information in the other fields of the analysis. In the calculated field, basic mathematical operations are supported by the use of constants and the analysis fields, DBMS functions and expressions are also available, which allow you to create more elaborate calculations, such as the percentage of the value over the total, accumulated value, etc.

 

During the analysis, in the "Construct query" step, the Calculated field button is displayed, which will only be enabled after the query is executed. Now, in OLAP, this functionality can be accessed through the plus_small button that is present in every item in the Dashboard.

 

By clicking on the calculated field button, the following screen will be displayed:

campo_calculado

 

1.Enter the Name of the column that will be displayed in the Query result with the result of the calculated field.

 

2.In the Formula field, enter the formula that will be used to calculate the information that will be displayed in the Query result. In the formula may be used:

Math operators (addition, subtraction, multiplication, division);

Other fields, which are displayed on the panel, in the Fields list section;

Constants, which are presented in the panel, in Constants section;

Functions and instructions supported by the database.

 

3.Click on the CASE button if you wish to use a verification that will allow a value to be displayed only under a condition. By clicking on this button, the system will display the conditional structure. Replace the following information in the formula:

 

campo_calculado_case

 

[CONDITION]: Enter the condition which will be verified.

[RETURN_IF_TRUE]: Enter the field, constant or operation which will be used as a result if the condition is satisfied.

[RETURN_IF_FALSE]: Enter the field, constant or operation which will be used as a result if the condition is not satisfied.

 

4.After entering the formula, at the bottom of this screen, the system will inform you if the formula is "OK", otherwise it will report the error found. If the formula is correct, click on the OK button.

 

5.At this point, the result obtained through the calculated field will be displayed in the Query result, in a new column, or in OLAP, depending on the view configuration performed in the vision.