I am trying to calculate a moving average in my sql script. It is a moving average because users supply a date range. For example,
Select a.hospital, avg(a.count) as 'Averages', a.date
from Records as a
group by a.hospital, a.date
having a.date >= @StartDate and a.date <=@EndDate
So in the SSRS graph, how do I create a straight line across bars (each bar represents the count) to simply show the average for all hospitals between the two dates?
Or in my query, how do I include the average calculation? I think if you just do avg(a.counts), then how will it be the average for date x and date y?
Say users want to see the average count for each hospital between 10/19/2015 to 11/30/2015. How will I get it to show just a straight line on the graph for avg between the two dates?
Thanks