Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Remove zeroes

janety0127
7 - Meteor

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.

3 REPLIES 3
AngelosPachis
16 - Nebula

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?

 

AngelosPachis_0-1614723198401.png

 

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

mceleavey
17 - Castor
17 - Castor

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.



Bulien

jrgo
14 - Magnetar

@janety0127 

 

change your the expression to 

if [_CurrentField_] = 0 then NULL() else [_CurrentField_] endif

 

" " (empty space) is not a valid numerical field. 

Labels