Tuesday, September 11, 2018

Return Zero Value Instead of Null when Multiplicand is Zero.

Creating an Item search using multiplication formula where the multiplicand may have a zero value shows null values in the search / saved search results.

 

To illustrate:

 

{totalvalue}+({quantityonorder}*{cost})

 

To correct this, apply the nvl() SQL Function to the field and add 0 at the end of the function. Doing so converts the null value to 0 which can be then be used on the formula.

 

The correct formula should appear like this:

 

{totalvalue}+nvl({quantityonorder}*{cost},0)

No comments:

Post a Comment