Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to chart the average age of our stock as at the end of each quarter.
So the average age will go down as old items are dispatched and up as they stick around.
E.g. a desk in stock that was 2 days old at the end of Q1 will be roughly 92 days old if it's still around by the end of Q2. The bar on the chart for Q1 will, therefore, be calculating the age of the desk differently than the bar at Q2.
I'm not sure how to do this. I can calculate the average age of items as at today using something like:
avg(today() - created_at)
But to make a chart that shows the age as at the time represented by the end of each period plotted is something I can't think how to do. Is it possible? How might I go about it?
Hope I explained the question in a way that makes sense.
can your provide some sample lines please?