Lag Window Functions gave me split rows

I am trying to use window functions for lag/lead. However no matter how I try, the table still show splits.

lag(sum(case when `control or target` = 'target' then `vol_usd` else 0 end)) over (partition by year(`trade_date`)*100 + month(`trade_date`))

Is there anything wrong here?


Sign In or Register to comment.

Hey, Stranger!

It looks like you're new here. Those who sign in get access to engage with even MORE fire content. To get involved, click one of these buttons!