SOLVED
Data formatting
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Abhii2658
8 - Asteroid
‎10-19-2021
07:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I need to change the data formats for the following
a. 123- needs to be changed to -123
b. All fields for a record with 00000 needs to be blank
Thanks in advance.
Solved! Go to Solution.
Labels:
- Labels:
- Data Investigation
2 REPLIES 2
20 - Arcturus
‎10-19-2021
07:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How about:
IF [_Current Field_] == "0000" THEN '' ELSEIF
RIGHT([_Current Field_] ,1) == "-" THEN "-"+ Trim_right([_current field_],"-")
ELSE [_Current Field_]
ENDIF
something like that should work and you can use it in a multi-field formual with a little change here or there.
BTW, '' is empty and NULL() is null
Cheers,
Mark
Alteryx ACE & Top Community Contributor
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
12 - Quasar
‎10-19-2021
07:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Abhii2658 -
This is a great use case for the Formula tool or Multi-Field Formula. Something like this should work for you.
IF Right([Field],1)="-" THEN "-"+Left([Field],Length([Field])-1)
ELSEIF [Field]="00000" THEN ""
ELSE [Field]
END
