I'm trying to calculate the standard deviation over a rolling 6 months. The code that I am using isn't giving me the correct calculation and I don't understand why. Below is the code, can someone help me understand what I am doing wrong and how to correct it?
cast(stddev_pop(indexgoal) over (partition by agency, fa order by fa, rpt_month rows 5 preceding) as decimal(12,5)) as stdIndGoal
rights to materials on this website, the rights you grant to your submissions to this website, and your responsibilities regarding your conduct on this website.