Hello All,
I am trying to create a graph of the monthly sales for a given customer of our organization.
I have a query that adds up the sales from our sales table and groups them by month (and obviously by customer).
However, if they didn't purchase anything in say... month 03 (March), there is no record created in the result.
The records look like this:
|Month Number|Total|Customer Number|
So, say I'm graphing the first 5 months of the year, but Customer A didn't buy anything in march, this is what I would get:
01 | $15.67 | A
02 | $12.22 | A
04 | $50.11 | A
05 | $23.56 | A
When I use this result in my smooth line graph, it graphs it nicely, but it is rather misleading.
The line between month 2 and 4 just goes straight from $12.22 to $50.11, rather than going back to $0 for month 3 (which is what I would prefer).
To sum it up:
I need a way to append the missing records to this result table for the months that don't have any sales.
Please not that this result table doesn't have just one customer, there are thousands. So, if there are 10 customers, I need 120 records in the final result (12 months for each of the 10 customers).
Please let me know if you have any suggestions. This has been bugging the heck out of me.
Thanks in advance for the assistance.
Max