Calculated Measures and Buckets (KPI Admin)
Calculated Measures
The Calculated Measures page allows you to define a custom field using a similar mapping configuration that the eMite RTBI engine uses for mapping Elasticsearch index fields.
Field Definitions
Field Name | Definition |
---|---|
Fact Query | Select the index where the Calculated Measure will be created |
Field | Enter the name for the Calculated Measure |
Type | Select the field data type; expects String, Date, or Double |
Is Measure | Checkbox selection if new field should be categorized as a Measure; If unchecked, the field will be categorized as a Dimension |
Visible | If the field is a Dimension, checkbox selection if new field should be visible; If the field is a Measure, checkbox selection is unnecessary |
Alias | (Optional) Alias for the field |
Max Terms | Maximum number of members for the field |
Is Epoch | Checkbox selection if new field date type is stored as Epoch |
Is LongText | Checkbox selection if new field string type is LongText |
Is Calculated | Checkbox selection if new field is a Calculated Measure; If true, eMite will calculate the value according to the Expression configuration |
Is Hierarchy | Checkbox selection if new field data is stored as a hierarchy |
Expression | (Optional) The expression used to determine the value for the Calculated Measure |
TimeLine Type | (Optional) Dropdown menu to select TimeLine type |
Bucket Definition | (Optional) If the expression should be evaluated against a Bucket definition, dropdown menu to select the existing bucket |
Convention | (Optional) Dropdown menu to select case convention for text |
Creating a Calculated Expression
General rules to follow when creating an expression:
When creating the expression, you must type everything into a single line. Do not use Enter to create a new line.
Field names must start with @.
There are some special characters in field names which must be replaced by keywords:
The space character (" ") must be replaced by the "_SPACE_" keyword. For example, a field called DATE OPEN is written as @DATE_SPACE_OPEN.
The dash character ("-") must be replaced by the "_DASH_" keyword. For example, a field called RefQuery-Price is written as @RefQuery_DASH_Price.
The dot character (".") must be replaced by the "_DOT_" keyword. For example, a field "Value.Keyword" is written as @Value_DOT_Keyword.
Mind the parentheses while creating complex expressions.
There must be a space before and after the operator. For example, "if(@name1>0)" is an invalid expression. The format should be "if(@name1 > 0)".
Using Bucket Definitions
The eMite RTBI engine can create a customized dimension for filtering a data by measure or expression according to a set of pre-configured value ranges. These dimensions are called buckets or bucket dimensions, and the configuration is sometimes referred to as bucketization.
Create a Bucket Definition
1. In KPI Admin, go to the Bucket Definition tab and click + Add new record.
2. Configure the Bucket Definition.
Name | (Required) This will be the name of the definition. This will be referenced in the Calculated Measure configuration; however, this bucket name will not be visible to dashboard users. |
Description | (Optional) This field allows for a detailed description of the definitions as desired. |
Ranges | (Required) Click + Add new record and enter the Lower and Upper bounds, and a Label. The label names will be used by the bucket dimension as member names, so these will be visible to dashboard users. |
3. Click Save.
Here is an example Bucket Definition created for evaluating the duration of SegmentTime.
Configure Calculated Measure with a Bucket Definition
The bucket definition does not do anything by itself; It will need to be referenced in a Calculated Measure configuration to be of use.
1. In KPI Admin, go to the Calculated Measures tab and click + Add new record.
2. Configure the new field.
Fact Query | Select the relevant index where you want to create the bucket dimension. |
Field | Provide the name for the new field. This name will be visible to dashboard users. |
Type | System.Double. |
IsMeasure | False (unchecked) |
IsVisible | True (unchecked) |
IsCalculated | True (checked) |
Expression | Enter the name of the field that you want to evaluate against the bucket definition, in the format @fieldName. |
BucketDefinition | Select the bucket definition that you want to use. |
3. Click ✓ to save the new field definition.
Here is an example where a new Dimension is being defined by evaluating the @SegmentTime field against the SegmentTimeBucket bucket definition.
For each record in the index, the value of the expression will be compared to the ranges defined in the bucket. In this example, the expression is just the field name so there is no further calculation applied to the value of that field. Each record in the index will then be associated with one of the members from the bucket definition where the field value fits within the range.
Using a Bucket Dimension
Once the calculated measure has been configured with a bucket definition, the new field will be available to use a dimension for that index. The dimension can be used in filtering reports and datablocks in the dashboard UI or can be used as a filter in KPI definition.
Here is an example where the new member, 000 – 030 seconds, of the SegmentTimeBucket dimension is being used to filter an existing KPI.
Additional Notes
Keep in mind that the members of a bucket dimension will filter the records of an index based off the value calculated by Expression in the configuration. As such, it is good to be aware of what sort of data is being stored in the target index. If an index contains aggregated data, then the bucketization will only be able to compare the aggregated value against the bucket definition.