Hi Team,
I have a data sets which i need to convert this numerical as per below
Description14 |
30 |
27.5 |
25.01 |
30 to read as "30.0" , 27.5 to read only as "27.5" and 25.01 to read as "25.01" - how can we set a formula for decimal integers to read it correctly ?
Thanks so much !
Regards,
Guru
Solved! Go to Solution.
Hi @Emil_Kos
Thanks for your response - I have a huge data set will have to set a formula which identifies below scenario's.
Numeric 30 to read as "30.0" and
no changes if data set shows as "27.5" to read as 27.5 and
25.01 to read it as 2 decimal points... Please advice.
I'm not sure you can get what you want - fixed decimal can (theoretically) enforce a set number of decimal spaces and double will allow you to have differing number of decimal places - but double does not create a whole number with a trailing decimal. So it seems to me like you want two different numeric types in the same column.
If it's for string display purposes may I present:
if REGEX_Match(tostring([test]),"\d+") then tostring([test])+(".0") else tostring([test]) endif
@Inactive User
Only way is if that field is converted to a STRING data type where you can customize the output. If that would be acceptable, the expression below used to create a new field would produce the desired format.
REGEX_REPLACE(TOSTRING([Description14], 2), '^(.+)0$', '$1')
Hope this helps!
Jimmy
Hi @Inactive User,
Now I know that I didn't understand your initial question correctly.
I believe @apathetichell and @jrgo got valid points in order to how you can tackle this problem.
One more question to you @Inactive User what is the reason that you want to highlight the data in this way?
Thanks !
I wanted to build a logic to match primary data with Alteryx output, hence i need a logic to build in such a way.
Hi @Inactive User,
Thank you for your explanation. Good luck with your project. I think @jrgo and @apathetichell provided you with valid answers that should help you along the way 🙂