The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

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
アステロイド

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件の返信1
griffinwelsh
クエーサー

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.

ラベル
トップのソリューション投稿者