Metric
Metric features are great for aggregations from one-to-many relations. It is commonly used to enrich an entity with aggregated fields from one-to-many related assets or entities.
When we create a metric feature, we apply a measure aggregation to the level of an entity.
Simple metric feature
In this example, we define simple metric
features for the entity customer
:
type
type
The feature type.
In case of metric features, it should be set to metric
.
name
name
Give the metric feature a name.
asset
asset
The data asset with the measure to be aggregated to the level of our entity.
asset
should be the full path: "db.schema.name".
asset
has to be related to our entity (see related data asset).
join_name
[optional]
join_name
[optional]In case multiple join patterns are defined between an entity and a data asset, join_name
is used to determine which join path to use for a specific feature.
For more information about using multiple join paths between an entity and a data asset, visit the related data assets page.
data_type
[optional]
data_type
[optional]Specify the feature data type.
If no data_type specified, Lynk will assume the data type is string
.
The options for data types are:
string
For any type of string data type
number
For any type of number data type. For example: integer, float, decimal etc..
datetime
For any type of time-based data type. For example: date, timestamp, datetime etc..
bool
For boolean data type.
time_field
[optional]
time_field
[optional]Specifies which asset time field to use in case of time-based aggregation is applied to the metric. If not specified, Lynk will use the asset's default time_field
.
See time aggregation for more information on how time fields are being used for time-based metric aggregations.
measure
measure
The name of the measure we would like to aggregate from the related asset to the level of our entity.
Measures are defined on a data asset level. See measures for in depth information on this.
filters
filters
Custom filters to be applied on the data asset. See filters page for in depth information on how to apply filters.
Last updated