|
|
|
|
Re: Dynamic monthly sales report [message #630652 is a reply to message #630465] |
Thu, 01 January 2015 13:53 |
|
Kevin Meade
Messages: 2103 Registered: December 1999 Location: Connecticut USA
|
Senior Member |
|
|
I am going to guess that your are asking about three common problems.
1. how do you get the dates to the report
2. how do you deal with a product/item with no sales during a particular month
3. how do you generate the output in the format shown
First I have to slap you around a bit because of the mistakes you have made that will prevent others from helping you.
1. typical of lazy IT people you have provided absolutely no information yet expect an answer to an ambiguous question. Where is the definition of the data you are working with for us to see. To your credit you did provide a result sample which is good. Littlefoot is not criticizing you for providing results from a non-oracle tool, just asking what tool you are using because that information might play into part of the answer to your question (assuming we are interpreting it correctly to begin with).
2. wanna is spelled WANT TO. wanna just sounds like someone crying.
OK that was fun, and I hope gives others enough relief that they will now be willing to provide more detailed help. So I will do so now.
Repeating my original opening remarks, I am going to guess that your are asking about three problems.
1. how do you get the dates to the report
2. how do you deal with a product/item with no sales during a particular month
3. how do you generate the output in the format shown
My initial commentary:
#1, depends upon what tool you are using. You need to somehow craft a query that can go against some row source that exposes the dates you need to use. You should provide us with this object definition (what is the table describe of your detailed data).
#2, requires that you do a data fill of some kind. This requires that you either find a list of product/item across which you need to report, or use possible CUBE features to get the result. You will have to research this to learn about such examples that match your particular problem. Indeed you may need two lists, one of the list of product/item you want to report across and one on the list of dates you want to sum to. The Cartesian product of these two will give you the data points you need to generate the matrix you have shown.
#3, will likely require a PIVOT of rows on the date column (or if you are fancy use of the MODEL clause).
As is hinted to above, there are features in the database that may allow you to get your answer without resorting to generating all the summary data points first and then doing join backs to them from the detail data in order to get your data points without missing any. I could put a more detailed example together but that would require me to spend a lot more time on it and frankly I am not willing to spend more time on an answer than you were willing to spend in asking your question.
Kevin
[Updated on: Thu, 01 January 2015 13:54] Report message to a moderator
|
|
|