Is it possible to limit decimal places in a column without using table tool?
I have a alphanumeric column with some data as only numbers while some alphanumeric.
The ones which are only number are upto 9-10 decimal places, I only want them to be limited upto 5. No rounding off needed as well, even if after 5 decimal places, the rest is cut off, is fine by me.
Try setting the data type to Fixed Decimal with 19.5 specified. Or you can use a Round function in the Formula tool!
Working on @alexnajm 's suggestion, it looks like this:
But since @Isha_Gupta mentioned:
@Isha_Gupta wrote:
Is it possible to limit decimal places in a column without using table tool?
I have a alphanumeric column with some data as only numbers while some alphanumeric.
The ones which are only number are upto 9-10 decimal places, I only want them to be limited upto 5. No rounding off needed as well, even if after 5 decimal places, the rest is cut off, is fine by me.
@alexnajm 's suggestion does round off to the nearest precision value. So it does not fit your exact criteria or no rounding off.
There is a great article here: https://databard.co.uk/mastering-rounding-in-alteryx/ fully on decimals.
If you just want to "chop" the length to 5 without action, this is something you can do:
Hey @Isha_Gupta - did the above solve your need? If so, can you kindly mark the solutions above as accepted solutions so that we can close the thread + help others find the solution faster? Thank you!
are there commas in your numbers? if no then regex_replace([my_text_column],"(\d+\.*\d{0,5})(\d+)","$1")
As I read this the column is a string - there are words - but also numbers. you want to identify what are the rows with numbers - and then truncate them. you would use some version of regex for that. My version would go in formula tool and would have [my_text_column] as your text column