Chaining Features
Features are reusable. It is possible to create features on an entity, based on features of another (related) entity. This makes it possible to create a full data pipelines within Lynk.
Example - creating features from related entities
For example, let's assume we have an entity called user
and another entity called team
, and their relation is many-to-one. You can create a feature called is_active_user
on the user
level and consume it for creating a metric feature active_users_count
on the team
entity level.
# user.yml (user entity)
asset: user
...
measures:
- name: active_users_count
description: count of active users
sql: SUM(IFF({is_active_user}, 1, 0))
# team.yml (team entity)
...
features:
- type: metric
name: active_users_count
asset: user
field: active_users_count
filters: null
Last updated