We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Round down to whole from decimal

DanielCarro
8 - Asteroid

Hi guys,

 

I am struggling to obtain the whole number by rounding down.

 

So I have the following

Data I haveI need to obtain this result
5,544,857.08115,544,857
-83,654.2524-83,654
5,461,202.82875,461,202
1,164,419.9870311,164,419
-17,567.393004-17,567

 

I tried using FLOOR() and Round([Field]-0.001.1), not working.

 

Any suggestion where I might be wrong.

 

Much appreciated your assistance.

 

Regards,

Dan

2 REPLIES 2
FinnCharlton
13 - Pulsar

Hi @DanielCarro , floor() isn't working for you because your're not always trying to round down. For the negative numbers, you're trying to round up. For example, -83,654.2524 round UP to -83,654, as -83,654 is bigger than -83,655.

 

To get the result you're looking for, try this formula:

 

floor(abs([Data])) * if [Data]<0 then -1 else 1 endif

 

Hope this helps!

DanielCarro
8 - Asteroid

Hi @FinnCharlton , it worked. Thank you very much

Labels
Top Solution Authors