Alteryx Designer Desktop Discussions

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

Multi-Field Formula to replace 0s with Hyphen

CDIns
8 - Asteroid

In my workflow, the last thing I do before I export is create a difference column. The problem I am running into is when I export, records with no differences populate the difference column with a "0". I want to replace these with a hyphen instead as its easier on the eyes. 

 

I currently have the difference field selected in my configuration and the expression I am using is:

 

if [_CurrentField_] =0 then "-" else [_CurrentField_] endif. 

 

This expression works but now my output shows blanks instead of the hyphen. Any ideas? am I approaching this the wrong way? 

 

Thanks, community. 

1 REPLY 1
griffinwelsh
12 - Quasar

Your fields must be strings to contain "-" as their value, but your formula indicates that your fields are numerical value data types. Set all relevant fields to string data type and update your formula to if [_CurrentField_] = "0" then "-" else [_CurrentField_] endif.

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels