metricflow icon indicating copy to clipboard operation
metricflow copied to clipboard

[SL-2251] [Bug] Error when trying to add a time dimension at a monthly grain as a non-additive dimension

Open Jstein77 opened this issue 9 months ago • 0 comments

Is this a new bug in metricflow?

  • [X] I believe this is a new bug in metricflow
  • [X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

I created a dimension called ordered_at at a monthly grain and a measure called orders with ordered_at as a non_additive_dimension. This creates an error:

  dimensions:
      - name: ordered_at
        expr: ordered_at
        type: time
        type_params:
          time_granularity: month
  measures:
     - name: order_count
        expr: 1
        agg: sum
        non_additive_dimension: 
          name: ordered_at
          window_choice: max
Encountered an error error querying against the semantic layer: Unable To Satisfy Query Error: Unable to join all items in request. Measure: order_count; Specs to join: LinkableSpecSet(dimension_specs=(), time_dimension_specs=(TimeDimensionSpec(element_name='ordered_at', entity_links=(), time_granularity=TimeGranularity.DAY, date_part=None, aggregation_state=None),), entity_specs=(), group_by_metric_specs=())

Expected Behavior

I should be able to specify ordered as non additive at a monthly grain.

Steps To Reproduce

Copy the above configs into jaffle-sl-template and try to query dbt sl query orders

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:
- metricflow:

Which database are you using?

No response

Additional Context

No response

SL-2251

Jstein77 avatar May 22 '24 18:05 Jstein77