Alteryx Designer Desktop Discussions

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

Rounding with more than one decimal

GCEagles
6 - Meteoroid

Here is an excerpt of the data that I need to be transformed:

 

CurrentWhat I need
22.1039999999999922.1040
22.1092.1122.1092.11
22.1040.1022.1040.10
22.201499999999822.2015
FH10202020FH10202020
022100210FSB022100210FSB

 

I need to round the first set of decimals to 4 places. The data is currently in string format because I will lose the data with the letters, if I convert to double

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

I achieved the desired result by splitting to rows on the period, then rounding the values that contained three 9's to the first 4 characters, then recombine the values by concatenating with a ".". 

 

Check out the attached workflow and let me know if that works for you.

 

 

GCEagles
6 - Meteoroid

Hey, sorry I also realized that in some instance there's data that is:

CurrentWhat I need
22.2023000000000000000122.2023

Where now that would be rounded down, so I would just add "000" to the formula?

CharlieS
17 - Castor
17 - Castor

No problem. I added and OR condition that looks for "0000" in addition to "9999" (i also extended to 4 characters).

 

 

GCEagles
6 - Meteoroid

Perfect thank you so much!

Labels