I writing a query and getting the value
I have tried this on SQL Server 2012
;With CTE_ColorIndicator
AS
(
select Name,Value,Report_Date,
Dense_Rank() Over(Order by Report_Date DESC)Dno,
(AVG(value)+(3*STDEV(value))) UpperLimit,
(AVG(value)+(3*STDEV(value)))*0.85 Limit
from #Temp1
group by Name,value,Report_date
)
Select *
from CTE_ColorIndicator
where Dno <=90 and Dno > 7
"I expected the aggregated values in the place of Upper-limit and limit columns" "But the output is showing 'NULL' values in the upper-limit and limit columns"