SAP Knowledge Base Article - Public

2130894 - NDIV0 Function in Key Figure Formulas

Symptom

You want to know why the NDIV0 function is used while creating a Key Figure.

Reproducing the Issue

  1. Go to the Business Analytics work center.
  2. Go to the Design Key Figures view.
  3. Search for any Key Figure which uses the NDIV0 function, say for example: Average Handle Time.
  4. Click on the Documentation.
  5. Find that the function NDIV0 is used in the Formula.

Cause

The NDIV0 function is used to avoid the error caused by division by 0. If you happened to use in your own key Figure an expression of the form DIV("EXP1","EXP2") where one of the values of "EXP2" happens to be 0 then this would raise an error. As a consequence, subtotals on this column would also throw an error.

By using the function the system will return 0 instead of an error.

For example, the formula for Average Handle Time is:

NDIV0(DIV("Ticket Handling Time (Secs)", "Counter"))

if the values for "Ticket Handling Time (Secs)" and  "Counter" are 4 and 0 respectively, then if NDIV0 function is not part of the formula then as per the formula, 4 divided by 0 will result in an error.

 

Resolution

Use NDIV0 to prevent the division by 0.

For Average Handle Time: NDIV0(DIV("Ticket Handling Time (Secs)", "Counter")) if the values are applied then, NDIV0(DIV("4", "0")) will result in 0 instead of an error.

This way subtotals (or any other calculation based on this formula) will not give an error.

Keywords

KBA , AP-RC-ANA , C4C, ByD, Travel: Analytics Tools & Frameworks , How To

Product

SAP BUSINESS BYDESIGN 1708 ; SAP Business ByDesign 1711 ; SAP Hybris Cloud for Customer add-ins 1708 ; SAP Hybris Cloud for Customer add-ins 1711