@@ -87,16 +87,31 @@ metrics there are #}
8787
8888 {{ metrics .gen_joined_metrics_cte (metric_tree[" parent_set" ], metric_tree[" expression_set" ], metric_tree[" ordered_expression_set" ], grain, non_calendar_dimensions, calendar_dimensions, secondary_calculations, relevant_periods) }}
8989 {{ metrics .gen_secondary_calculation_cte (metric_tree[" base_set" ], non_calendar_dimensions, grain, metric_tree[" full_set" ], secondary_calculations, calendar_dimensions) }}
90- {{ metrics .gen_final_cte (metric_tree[" base_set" ], grain, metric_tree[" full_set" ], secondary_calculations,where ) }}
91-
90+ {{ metrics .gen_final_cte (
91+ metric_tree= metric_tree,
92+ grain= grain,
93+ dimensions= non_calendar_dimensions,
94+ calendar_dimensions= calendar_dimensions,
95+ relevant_periods= relevant_periods,
96+ secondary_calculations= secondary_calculations,
97+ where = where )
98+ }}
9299
93100{# If we're calling the develop macro then we don't need to loop through the metrics because we know
94101this is only a single metric and not an expression metric # }
95102{%- elif is_develop_macro - %}
96103
97104 {{ metrics .build_metric_sql (metric_name, metric_type, metric_sql, metric_timestamp, metric_filters, metric_model, grain, non_calendar_dimensions, secondary_calculations, start_date, end_date, calendar_tbl, relevant_periods, calendar_dimensions, dimensions_provided) }}
98105 {{ metrics .gen_secondary_calculation_cte (metric_tree[" base_set" ], non_calendar_dimensions, grain, metric_tree[" full_set" ], secondary_calculations, calendar_dimensions) }}
99- {{ metrics .gen_final_cte (metric_tree[" base_set" ], grain, metric_tree[" full_set" ], secondary_calculations,where ) }}
106+ {{ metrics .gen_final_cte (
107+ metric_tree= metric_tree,
108+ grain= grain,
109+ dimensions= non_calendar_dimensions,
110+ calendar_dimensions= calendar_dimensions,
111+ relevant_periods= relevant_periods,
112+ secondary_calculations= secondary_calculations,
113+ where = where )
114+ }}
100115
101116{# If it is NOT a composite metric, we run the baseline model #}
102117{%- else - %}
@@ -123,8 +138,17 @@ this is only a single metric and not an expression metric #}
123138 {{ metrics .build_metric_sql (metric_name, metric_type, metric_sql, metric_timestamp, metric_filters, metric_model, grain, non_calendar_dimensions, secondary_calculations, start_date, end_date,calendar_tbl, relevant_periods, calendar_dimensions,dimensions_provided) }}
124139 {% endfor %}
125140 {{ metrics .gen_secondary_calculation_cte (metric_tree[" base_set" ], non_calendar_dimensions, grain, metric_tree[" full_set" ], secondary_calculations, calendar_dimensions) }}
126- {{ metrics .gen_final_cte (metric_tree[" base_set" ], grain, metric_tree[" full_set" ], secondary_calculations,where ) }}
127141
142+ {{ metrics .gen_final_cte (
143+ metric_tree= metric_tree,
144+ grain= grain,
145+ dimensions= non_calendar_dimensions,
146+ calendar_dimensions= calendar_dimensions,
147+ relevant_periods= relevant_periods,
148+ secondary_calculations= secondary_calculations,
149+ where = where )
150+ }}
151+
128152{%- endif - %}
129153
130154{% endmacro %}
0 commit comments