File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 216216 comparison as (
217217 select
218218 curr.bucket_end as current_period,
219- prev .bucket_end as previous_period,
219+ prev_b .bucket_end as previous_period,
220220 {{ elementary.edr_cast_as_int("curr.row_count") }} as current_row_count,
221- {{ elementary.edr_cast_as_int("prev .row_count") }}
221+ {{ elementary.edr_cast_as_int("prev_b .row_count") }}
222222 as previous_row_count,
223223 case
224- when prev .row_count is null or prev .row_count = 0
224+ when prev_b .row_count is null or prev_b .row_count = 0
225225 then null
226226 else
227227 round(
228228 cast(
229- (curr.row_count - prev .row_count)
229+ (curr.row_count - prev_b .row_count)
230230 * 100.0
231- / prev.row_count as {{ elementary.edr_type_numeric() }}
231+ / prev_b.row_count
232+ as {{ elementary.edr_type_numeric() }}
232233 ),
233234 2
234235 )
235236 end as percent_change
236237 from bucket_numbered curr
237238 inner join max_bucket on curr.bucket_num = max_bucket.max_num
238- left join bucket_numbered prev on prev .bucket_num = curr.bucket_num - 1
239+ left join bucket_numbered prev_b on prev_b .bucket_num = curr.bucket_num - 1
239240 ),
240241
241242 volume_result as (
You can’t perform that action at this time.
0 commit comments