In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Alteryx rounding function

Carluccio555
9 - Comet

This formula is failing:

 

round([Gross Margin]/[Gross_Revenue]*100,0.1)

 

Is it because the round function can only accept 1 field as an input? If not how can I make it work?

 

 

 

 

3 REPLIES 3
flying008
15 - Aurora

Hi, @Carluccio555 

 

Please try this formula:

Round(ToNumber([Gross Margin])/ToNumber([Gross_Revenue])*100,0.1)
apathetichell
20 - Arcturus

@Carluccio555what @flying008 is saying is that you the most common reason that your formula would fail is that one or both of your fields are not numbers. tonumber() will convert them to numbers.

 

If these are both numbers - you can also add a check to see if you are dividing by zero by saying:

 

if [Gross_Revenue]!=0 and !isnull([Gross_Revenue]) then ... (insert your nifty formula here) else 0 endif

DenisZ
11 - Bolide

To make it easier to troubleshoot it would be nice to see what the issue is. Immediately, there appears to be no issue, but I could assume that they are going in as V_WString and not a Double/Int, so maybe try ToNumber([GrossMargin]) And ToNumber([Gross_Revenue])

 

Hope it helps. 

Labels
Top Solution Authors