We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Convert portion of rows to FixedDecimal and leave others as V_String

Rob48
8 - Asteroid

My data is in V_String and looks like the below.  I need to convert the "1" values to FixedDecimal and leave the "Not Required" as V_String for my output into an excel worksheet.  I should mention all the data in that column was originally FixedDecimal and I needed to convert some of them to "Not Required" based on other criteria.  If there's a way to get the initial calculation of the existing FixedDecimal values to return "Not Required" as V_String and leave those not converted from numbers as is, this would save me a step as well.  Thanks for any help you can provide

 

 

Courses Complete as %
1
1
Not Required
Not Required
Not Required
2 REPLIES 2
PhilipMannering
16 - Nebula
16 - Nebula

Hi @Rob48 

 

You cannot mix field types within a single column. The best you can do is replacing Not Required with Nulls, and have another field that flags whether or not this field is required.

apathetichell
20 - Arcturus

if [field]]='Not Required' then [field] else tostring(tonumber(round([field],.00001))) endif

 

or something like that -> depending upon how many digits you want. To be clear - you are not converting your field to fixed decimal or any numeric type - you are formatting the display of a numeric value in your string. It's still a string.

Labels
Top Solution Authors