0

Avoiding dividing by zero (0)

I have a business formula field with the following formula:

if(

    OPS_Metrics.CallCountbyDay.IsPhoneActivity = 0,

    0,

    OPS_Metrics.CallCountbyDay.IsRightPartyConnect / OPS_Metrics.CallCountbyDay.IsPhoneActivity

)

When I try using this, if gives me the following error:

INC_04050744: Unexpected error while rendering query.

How do I prevent divide-by-zero scenarios?

The fields in the formula come from a business view in the same business schema.

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Marc,

    Boolean condition in the formula is:

    OPS_Metrics.CallCountbyDay.IsPhoneActivity = 0

    That will avoid divide-by-zero scenario correct? If IsPhoneActivity is 0 this formula will return 0.

     

    About the error:

    - These attributes in the formula above are attributes from physical table in business view  or they are  formula in business view?

    Like
    • Anurag Malik The attributes are from a physical table in the business view.

      Like
    • Marc Paige Put the denominator inside a if() and check if that is 0, if true return 1 else that value .

      Like 1
    • Amit Kothari I will try this technique. Thanks.

      Like
Like Follow
  • 2 mths agoLast active
  • 4Replies
  • 17Views
  • 3 Following

Product Announcement

Incorta 4.9 is now Generally Available (GA)!!!