Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Divide by Zero Warning

ankitgupta
7 - Meteor

I am using this formula in formula tool to calculate percentage :

ToString([Value]/[Value]*100,1,0)+"%"

 

But I am experiencing this warning "Divide by 0 error on record #1 in field New Value". Can someone please help me to solve this.

 

Thanks,

Ankit

 

 

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus
ToString([Value1]/[Value2]*100,1,0)+"%"

How about:

IF [value2] = 0 THEN "0%"
ELSE
ToString([Value1]/[Value2]*100,1,0)+"%"
ENDIF

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ankitgupta
7 - Meteor

Thanks you Mark this helps :) 

kiotsuresh
8 - Asteroid

@MarqueeCrew Hi Marq,

 

I'm Using the below formula in the Multi row formula tool,

([Row-1:Value]) * (1+(([Row-12:Value] - [Row-13:Value]) / [Row-13:Value]))

 

and getting this warning, Please help me to resolve this.

kiotsuresh_0-1671691132286.png

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

If your divisor is zero you can either create an error before the formula with a message tool, filter those records out and do something special with them or include an if condition to set the value to null.  

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels