Comments
-
Thanks @jaeW_at_Onyx & @MarkSnodgrass , adding an additional column works. Hopefully DOMO can fix this problem.
-
Sorry I used order by instead of partition. But in either case, both wont sum up but gave me 31 rows of 202101. lag(sum(case when `control or target` = 'target' then `vol_usd` else 0 end)) over (order by year(`trade_date`)*100 + month(`trade_date`))