Continuous Chart when there are NULL values in GoodData

This topic was covered imperfectly on gooddata support forums: https://support.gooddata.com/entries/491070-How-to-get-zeros-not-blanks-in-reports- 

There may be a time where you are trying to create a chart of # of events (COUNT), where there is no event in a given date dimension, and it creates a weird chart.

Such as:



Above you can see that over the last 15 months (right now it is November 2015), there is no Churn in Nov2014, and Feb2015 and onwards.  However the filter is the last 15 months and the user would expect to see a 0 in between all the events.  Since it is counting an event (SELECT COUNT (id (Events)) WHERE Event = Churn), and there are no Churn events during those months, they disappear from GoodData.

To remedy this, you can simply create the metric:

SELECT IFNULL ((SELECT COUNT (id (Events)) WHERE Event = Churn),0) + 0

What I changed is adding a IFNULL, and combining it with a "+0". 

And you get a beautiful continuous chart.



Comments