I have an entity which has an "amount" attribute and a "date" attribute. I have many of these entities, multiple in a day. I want to provide a daily avg of amounts, say over the span of a month.
I understand how to get the average of day's worth of amounts using the aggregate functions. But I don't understand how to return a list of daily averages for all the days in my data set.
It seems like there must be a better way than to create a fetch request for each day? Perhaps i have to utilize subqueries in some fashion?
(Related, but different, I also would like to calculate a moving average, so that I could return, say, a 20 day moving average of amounts. In this case, a list of avg.'s, each of which is the 20day average at that day)