Happy 8th birthday to the Maveryx Community! Take a walk down memory lane in our birthday blog, and don't miss out on the awesome birthday present that all Maveryx Community members get to take advantage of!
alteryx Community

# Alteryx Designer Desktop Discussions

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

## Divide by Zero Warning

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
20 - Arcturus
ToString([Value1]/[Value2]*100,1,0)+"%"

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.
7 - Meteor

Thanks you Mark this helps :)

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.

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.