Remove zeroes
- 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,
I have a workflow where I perform calculations on multiple columns and in order to do so, all field types must be double. Before I output, I convert all fields to string. In my output, I need all records that equal 0 to be replaced and output as empty. I tried using the multi field formula tool using this formula
if [_CurrentField_] = "0" then " " else [_CurrentField_] endif but it would not work. Any suggestions??
Thanks in advance.
Solved! Go to Solution.
- Labels:
- Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @janety0127 ,
Your formula looks correct, apart from the fact that " " is not empty of value but it has a whitespace in there. If you are looking for totally empty values, then you should replace " " with "" by removing the whitespace.
Also, are you sure you have not selected to output the fields as separate columns?
This is the default setting in the multi-field formula tool and your formula might be applied correctly but the fields might be outputted on the right hand side of your result pane and you can't see them.
If none of those help, maybe you can attach a sample of the data or at least a screenshot? It might help
Thanks,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @janety0127 ,
When you say it doesn't work, do you mean you receive an error?
If so, is the error relating to an "operator==" error? If so, you need to convert your fields to be strings as the "0" in your formula is a string and not a numeric value.
If not, can you give us more information regarding what you mean by "it's not working"?
M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
change your the expression to
if [_CurrentField_] = 0 then NULL() else [_CurrentField_] endif
" " (empty space) is not a valid numerical field.