Metric
Last updated
Last updated
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.
In this example, we define simple metric
features for the entity customer
:
type
The feature type.
In case of metric features, it should be set to metric
.
name
Give the metric feature a name.
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".
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.
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]measure
The name of the measure we would like to aggregate from the related asset to the level of our entity.
filters
asset
has to be related to our entity (see ).
For more information about using multiple join paths between an entity and a data asset, visit the page.
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 .
See for more information on how time fields are being used for time-based metric aggregations.
Measures are defined on a data asset level. See for in depth information on this.
Custom filters to be applied on the data asset. See page for in depth information on how to apply filters.