Reputation: 2856
I have a pivot table showing the total of orders in each month of year. Each column is a year and each row is a month. Some months don't have values at all, e.g Sept 2006. There is still a 2006 column for other months that have values and there is still a Sept row for the other years. Just the cell for Sept 2006 is empty.
How can I have a 0 put in this cell?
Upvotes: 0
Views: 2675
Reputation: 13496
Use nvl(value, 0) in your query. It substitutes NULL (empty) with 0.
Upvotes: 1
Reputation: 3893
Pivot table in what? Excel? can't you just do that in Excel? well if not...
Just because the columns have a 2006 and the rows have a Sept, doesn't mean your data source has a row for Sept 2006. If it does then Lynette has your answer. If it doesn't you'll need to outer join to a table/sql of all months and years to create your null records. And then you can coalesce those nulls to zero.
Upvotes: 1
Reputation: 404
If by "empty" you mean NULL, try using Coalesce( UrMonth, 0 )
Upvotes: 0