Getting a desired format as an output for Numbers and texts
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
Hope you are doing good!
I ran into a situation where in a column I have specific codes like:
8.1
79.12G
68.FD
Then I would get the desired output in the following format such that 8.1 gets converted into text as 8.10 but the other texts should not change:
8.10
79.12G
68.FD
If this is possible then it would be great if someone can guide on this. Thanks!
- Labels:
- Interface Tools
- Join
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What about?
padright([Field1], 5, '0')
This works for the data your provided.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @db89
One way of doing this.
IF REGEX_Match(Right([INPUT],1),"\d") = -1
THEN [INPUT]+"0"
ELSE [INPUT]
ENDIF
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @ShankerV the formula works but it adds 0 at the end of those texts which dont have a " . "
lets say if i add 821 then it becomes 8210
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @db89
Please find the amended formula.
IF !Contains([INPUT], ".")
THEN [INPUT]
ELSEIF REGEX_Match(Right([INPUT],1),"\d") = -1
THEN [INPUT]+"0"
ELSE [INPUT]
ENDIF
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @ShankerV that works really well! There is one tiny problem which is setting it off, is lets say if i have a decimal no. 87.377 then alteryx is throwing it as 87.376999999. Can we control the same in the same formula you used? None the less, thank you so much! :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
