Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Month Over Month Showing Incorrect Result

$
0
0

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


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>