Insight (OBIEE) Tips: How to force blank values to display as 0
You may have noticed metrics in your Eloqua Insight reports showing blanks as well as 0s.
Here is an example email analysis:
The blanks actually represent a NULL - meaning there is no value for that metric. In the case of bouncebacks you will only see values for hard and soft bouncebacks if there was a bounceback (i.e email delivery is less than 100%). On the other hand, Total Bouncebacks does show 0s. This is because the metric is using an aggregated table. An aggregated table stores the pre-coumuted results of Total Hard and Total Soft bouncebacks. So in the case of an aggregated table, you will see 0 instead of a NULL value.
Get rid of the NULLs
In many cases, your report consumers might want to see 0s instead of NULL values. So, here is how you can customize Insight to show a 0.
Start by customizing the column formula:
- Open your report for editing.
- On the Criteria tab, click the Settings icon next the column you want to update and click Edit Formula.
Then choose one of these SQL functions to handle the NULL:
- IFNULL() function
- CASE statement
Option 1: IFNULL() function
Technical Definition: Tests if an expression evaluates to a null value, and if it does, assigns the specified value to the expression.
Syntax: IFNULL(expr, value)
IFNULL("Activities"."Total Hard Bouncebacks",0)
Option 2: CASE statement
This form of the CASE statement evaluates each WHEN condition and if satisfied, assigns the value in the corresponding THEN expression. If none of the WHEN conditions are satisfied, it assigns the default value specified in the ELSE expression. If no ELSE expression is specified, the system will automatically add an ELSE NULL.
Syntax: CASE WHEN request_condition1 THEN expr1 ELSE expr2 END
CASE WHEN "Rates"."Hard Bounceback Rate" IS NULL THEN 0 ELSE "Rates"."Hard Bounceback Rate" END
Alternate: Use binning
Alternatively to building a CASE statement, you can use the Bins tab to bin the results. Here is an example:
- If NULL values are going to cause confusion with your report consumers, consider using the custom formulas to replace NULLs with 0.
- Each column will need to be customized to force 0s, so consider doing this once in a template report that you’ll use to build your final reports.