Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,60 +1,81 @@
---
semantic_model:
name: accounts_source
defaults:
agg_time_dimension: ds
description: accounts_source

node_relation:
schema_name: $source_schema
alias: fct_accounts
schema_name: $source_schema
primary_entity: account
entities:
- name: user
type: foreign
expr: user_id
dimensions:
- name: ds
type: time
type_params:
time_granularity: day
- name: ds_month
type: time
type_params:
time_granularity: month
expr: ds_month
- name: account_type
type: categorical

defaults:
agg_time_dimension: ds

measures:
- name: account_balance
---
metric:
name: account_balance
description: account_balance
type: simple
type_params:
expr: account_balance
metric_aggregation_params:
semantic_model: accounts_source
agg: sum

- name: total_account_balance_first_day
---
metric:
name: total_account_balance_first_day
description: total_account_balance_first_day
type: simple
type_params:
expr: account_balance
metric_aggregation_params:
semantic_model: accounts_source
agg: sum
expr: account_balance
non_additive_dimension:
name: ds
window_choice: min

- name: current_account_balance_by_user
---
metric:
name: current_account_balance_by_user
description: current_account_balance_by_user
type: simple
type_params:
expr: account_balance
metric_aggregation_params:
semantic_model: accounts_source
agg: sum
expr: account_balance
non_additive_dimension:
name: ds
window_choice: max
window_groupings:
- user

- name: total_account_balance_first_day_of_month
---
metric:
name: total_account_balance_first_day_of_month
type: simple
type_params:
expr: account_balance
metric_aggregation_params:
semantic_model: accounts_source
agg: sum
expr: account_balance
agg_time_dimension: ds_month
non_additive_dimension:
name: ds_month
window_choice: min
create_metric: true

dimensions:
- name: ds
type: time
type_params:
time_granularity: day
- name: ds_month
type: time
expr: ds_month
type_params:
time_granularity: month
- name: account_type
type: categorical

primary_entity: account

entities:
- name: user
type: foreign
expr: user_id
Loading
Loading