Setting a value to a negative number
- 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 everyone,
This might be simple but I just cant see a way to actually do it: I have a use case where I need to set all numbers less than 0 to -0.
I have no idea if that's actually possible but any insights would be great.
Solved! Go to Solution.
- Labels:
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Deano478 you can multiple your numeric values by -1 and that should do the trick. If you have multiple numeric columns that you need to apply this to you can use a Multi-Field Formula Tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @Deano478, if you need to have the negative sign beforehand then you'll need to output the result as a string. If not then you can just change the output data type to numeric and it'll switch to just 0:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Deano478
One way of doing this.
Input was:
As -0 is not INT type, I have just replaced with -1 so that we don't want to have change the data type.
Hope it helps!!!!
IF [Field1]<0
THEN -1
ELSE [Field1]
ENDIF
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
According to me the formula tool will be the best option to go with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Cheers guys for the various approaches I was able to blend them together and get the desired results
