Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

How to RoundUp?

KarlWang
メテオール

 

I saw there are functions CEIL() can change data from ceil(6.54) to 7 and  Floor(6.54) to 6.

 

I would like to use roundup() functions.

Such as:

324 to 400

3425 to 4000

3425.123 to 4000

 

Anyone know how to do it? Thank you.

 

13件の返信13
KenMorrill
メテオール

Assuming your data in is [Value]

 

IF [Value] - FLOOR([Value]) = 0 THEN [Value] ELSE FLOOR([Value]) + 1 ENDIF

apathetichell
ポルックス

@KenMorrill  try these two:

ceil([unit price]*100)/100

if regex_match(tostring([unit price]),".*\.\d{2}.*[987654321]+$") then (floor([unit price]*100)+1)/100 else [unit price] endif

 

phottovy
13 - Pulsar
13 - Pulsar

Just for fun, here is my dynamic formula that I believe works with all lengths:

 

 

Round([Value], ToNumber(PadRight('2', Length(ToString([Value], 0)), '0')))

 

Edited:

@dataMack I was able to round up using a 2 in front of my multiple using the round formula. I don't know if it would work in every situation but it worked with every number I tested including rounding 900 up to 1,000

 

 

boglarkalipka
アステロイド

sorry, wrong post

ラベル