Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need assistance with formula tool

bh1789
8 - Asteroid

I have copied formula in .png file:

 

output column is Value Trimmed and data type is Double

if contains ([Value], "%") then [Value Trimmed]/100 else [Value Trimmed] endif

 

when Value=98.05% the above formula outputs 0.9805 as expected

 

however, when Value="N/A" the above formula outputs N/A as [Null]

 

how would I update the above to include N/A in the output when Value=N/A?

 

Thank you

2 REPLIES 2
rzdodson
12 - Quasar

From the looks of it, you are attempting to work with Double and Strings within the same formula structure without the proper IsNubmer or IsString syntax.

Here is an example of how one can wrap the IsNumber function to perform the calculation on a string field where the data appears to be numeric.

 

Solution.png

binuacs
21 - Polaris

@bh1789 You need to change the data type from double to String to include the 'N/A'

If Contains([Value], '%') Then [Value Trimmed] /100 
ElseIF [Value] = 'N/A' Then 'N/A'
Else [Value Trimmed]
EndIF
Labels
Top Solution Authors