views:

63

answers:

0

I have a pivot table that I need to have return NULL whenever there is not a value in the database. This seems pretty simple when you look at the Google API for their query language: http://code.google.com/apis/visualization/documentation/querylanguage.html#Pivot

Google's Example showing nulls
My chart does not have nulls
The Google example is the first image. Notice how it contains null, these null values are from data that does not exist in the original table. When I run the sum(vals) for the pivot to work, it always returns 0, even if it doesn't exist.

Also, my sql statement is:
SELECT weekNumber, sum(value) FROM allval
WHERE weekNumber != 0 AND custId != 28
GROUP BY weekNumber
PIVOT custId
ORDER BY weekNumber

Notice the custId != 28. It still appears in my result table, except everything is set to 0.

Anyone know how the Google example in the link was able to maintain the NULL values even through the aggregate function sum?