Good Afternoon Team,
Hoping you can help me .
Every month i get a count of records associated to a table. What i would like to do is month on month calculate the % variance (between jan vs feb, feb vs march etc). if the % variance is greater than the threshold of 10% then a new column called result should say "fail" we estimate that that the table should only grow 1/2% per month, if its over 10% then we need to investigate as we believe this is an issue with the loading of the table
Threshold = 10% Variance = Result = PASS or fail
Table PS & Data
create table #PS ( CountN nvarchar(80), Month nvarchar(80) ); INSERT INTO #PS VALUES ('1000', 'Jan'), ('1100', 'Feb'), ('1500', 'Mar'), ('3000', 'April');
Table PS Result :
CountN Month 1000 Jan 1100 Feb 1500 Mar 3000 April
CountN Month Variance Result 1000 Jan 1100 Feb 10% P 1500 Mar 36% F 3000 April 100% F
whats the best way to achieve this.
looking forward to your help