How can I create measures in dimensional tables without time dimensions?
It seems that having a primary time dimension is a requirement from metricflow when creating a data source with measures.
I ran across your question when trying to solve a similar problem in my own models this morning.
I solved this by creating a “proxy” time dimension using current_date
dimensions:
- name: measure_time
expr: 'current_date'
type: time
type_params:
time_granularity: day
Note: I am running dbt against a Redshift instance. If using other SQL dialects, replace the current_date expression with the corresponding SQL function of your environment
The idea is that in cases like this -for customer dimensions, or other descriptive entities- measures associated are often attempting to get counts, or other simple aggregations, irrespective of time; in other words, the current state of the data. So, even though the current date is arbitrary as far as our data is concerned, it serves a function that can be rationalized