Do you have reports where the X-Axis value disappears if it is a 0 value?
For example, in this bar graph the hours 3, 4, and 5AM have disappeared because no tickets were solved in those hours. It's easy to not notice that the value has disappeared, so it's nice to keep the value there even if the value is 0.
Building the metrics
To achieve this, we will need to create a custom metric using the IFNULL function. In this example we are reporting on # of Solved Tickets by Hour Ticket Solved , but this metric structure can be used for any metric.
To build the # of Solved Tickets metric:
- Click Reporting ( ) in the sidebar, then click the Insights tab.
- Click the GoodData link in the top right corner of the panel.
- For reporting on the # of Solved Tickets, it's easiest to duplicate the metric. In Insights click Manage > Metrics > # Solved Tickets > Duplicate .
Now we can work on building the new # of Solved Tickets Including 0 metric. The complete metric is shown below.
To build the # of Solved Tickets Including 0 metric:
- Start by naming your new metric > Edit .
- At the beginning of the metric type: SELECT IFNULL ((
- At the end of the metric type: ), 0)*1
- Click Save .
Creating the report
Next, we'll want to create our report with this new metric. A completed report is shown below this section.
To create the report:
- Click Reports > Create report .
- In the What panel select # of Solved Tickets Including 0.
- In the How panel select Hour Ticket Solved.
- Change your graph type to Bar chart .
- Optional Step: Add Data Labels:
- Select Show Configuration > Global Settings .
- Check the Data Labels box.
- Click Apply .
There you have it - Your report will now maintain 0 values! Again, the IFNULL function can be applied to any metric. This report is just an example to show how useful the IFNULL function can be.