Hi ,
I m using below SQL query to calculate MoM but it showing me incorrect result
with x as (
select dt, platform, Metric,
lag(Metric) over(partition by platform order by dt) as prev_payment
from [dbo].[vw_Metrices]
)
select * from x
Note : Issue is Metric Value for date 10/25/2018 is missing in Prev_payement column.Therefore total of both columns are not matching