The following steps show how to display a NULL value (a blank value) as a 0.
This can be helpful when you need to use the value to perform calculations or need a consistent layout in the report.
In the example used the third row has a NULL value.
Option 1: Use a formula field
This is the typical approach I take – I create a formula field and use a formula to say ‘if value is NULL then 0 else use value’.
- Right-click on ‘Formula Fields’ and choose ‘New’
- Give the formula field a name, e.g. percent_fixed
- Use the following formula, replacing {Sheet1_.percent} with your own field
-
if ISNULL( {Sheet1_.percent} ) then 0 else {Sheet1_.percent}
- Save and close the formula editor
- Add the new formula field to your report
- The NULL value will be presented as a 0
Option 2: Use report options to convert all NULL values
Whilst this option usually works fine, I have had issues using it with some more complicated reports. For this reason I usually avoid option.
To enable this:
- With your report option, click on the ‘File’ menu and then ‘Report Options’
- Tick ‘Convert Database NULL Values to Default’ and click ‘OK‘ to save the changes.