Creating dynamic value range, one week at a time
Every Monday, I query a table to get data for the past week, every Monday (last Monday) to Sunday. I do some calculations with the data and insert the data and dates into a table.
I then use cfchart to create a graph using this data. The drilldown uses the same weekly date range to produce a report. So the record count for the chart and the report should be the same.
What I just discovered is that more data can be added to the query table after I have already obtained the data. Since the data for the chart is already in the table, it is static. But the report is dynamice since it uses the weekly date range everytime the drilldown is selected. This causes the count of the report to be different than the count of the chart.
Instead of gathering data every Monday and inserting into a table, for the chart, how can I make the chart data dynamic ?
I need to plot a rolling 12 weeks worth of data, always from Monday to Sunday, inclusive. So if I decide to run the chart on a Wednesday, how would I gather the twelve weeks worth of data, always from Monday to Sunday ? I need to make this dynamc.
The reports always work because the drilldown is pasing it the dates, thats why the count is always correct. But I do not know how to do this with the chart, which needs to be dynamic also, since static will not work.
Any help appreciated. Thanks
