Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Number rounding up

ayadav8
8 - Asteroid

Hey,

Needed help to know if there is a tool in Alteryx which can help me in rounding up numbers. I need rounding up in hundreds only:

1. Ex- if my number is in between 150-200 , tool should make it next hundredth place i.e 200

2. if my number is in between 101-149, tool should make it 100

3. if it is already in hudreds it shouldn't change anything.

 

Thanks!!

3 REPLIES 3
MarqueeCrew
19 - Altair
19 - Altair

@ayadav8,

 

Let's try this formula for Field1:

 

IIF(Round([Field1], 100)<[Field1],Round([Field1]+100, 100),Round([Field1], 100))

If you use the round function, rounding to nearest 100 and the result is less than the original number then add 100 and round it.  Otherwise, if the rounding was more than the original number then keep that rounding.

 

Alternative approach:

Max(Round(field1, 100),Round([Field1]+49,100))

Maximum of round to nearest 100 and add 49 and then round to nearest 100.  Both get same results.

 

Alternative approach:

ceil([field1]/100)*100

Round up to next integer the result of field1 divided by 100 and multiply that number by 100.  All 3 get same results.

 

Seems to work for me.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Please Subscribe to my youTube channel.
jrgo
13 - Pulsar

Hi @ayadav8,

 

You mention that you want to round up, but your examples suggest that you want the value to round to the nearest 100. If so, the formula below should be all you need.

Round([RowCount],100)

image.png

ayadav8
8 - Asteroid

Thanks! The logic works

Labels