http://stackoverflow.com/questions/3189763/google-sql-pivot-make-0-show-null

The link above describes exactly the issue I'm having.  No answers
there, means I come here.  Here is the problem:

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

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?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to