Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Parse Error at char(19): Formula: tried to apply numeric operator to a string value

Pramod91
8 - Asteroid

Hello everyone, 

I am trying to multiply the value in two columns (Ex Factory Price) and (ConversionRate) with each other using the formula :-

[Ex Factory Price]*[ConversionRate] in the formula tool.

 

However, I am getting an error which says - Error: Formula (73): Parse Error at char(19): Formula: tried to apply numeric operator to string value (Expression #1)

 

I have changed the type to Int32 using Select tool before the formula tool, but still getting this error. Can someone please help me?

10 REPLIES 10
atcodedog05
22 - Nova
22 - Nova

Hi @Pramod91 

 

Can you give this formula a try

 

ToNumber([Ex Factory Price])*ToNumber([ConversionRate])

 

Here is a work for the task

atcodedog05_0-1601109488951.png

Hope this helps : )

 

If this helps please mark the post as solution

Pramod91
8 - Asteroid

Thank, that works..

Also, I have got values after calculation as "0" for some rows. How can I filter them and replace with a "-".

I have the "0" value for multiple columns, so is there a way I can filter out these "0" and replace them with a "-" for all columns in one go?

 

atcodedog05
22 - Nova
22 - Nova

Hi @Pramod91 ,

 

Here is a workflow for the task.

Input

atcodedog05_0-1601116158234.png

Workflow

atcodedog05_1-1601116179566.png

Here i am using Muti-Field Formula tool. You select the column in the below list in the tool.

atcodedog05_2-1601116272981.png

Output

atcodedog05_3-1601116298187.png

But beware changing 0 to '-' will change column to string.

 

Hope this helps : )

 

If this helps please mark the post as solution.

Pramod91
8 - Asteroid

It gives me an error - Error: Multi-Field Formula (80): Parse Error at char(20): Invalid type in operator ==.

 

atcodedog05
22 - Nova
22 - Nova

Hi @Pramod91 

 

I have updated the workflow to fix the issue. Can you check now.

 

Pramod91
8 - Asteroid

Before calclulations, the Ex Factory price column contains values "-" which on multiplication with the value in Conversion rate column gives the value "0"

 

atcodedog05
22 - Nova
22 - Nova

_

atcodedog05
22 - Nova
22 - Nova

Hi @Pramod91 ,

 

Really sorry for inconvenience. Here is the right one. 

 

Input

atcodedog05_0-1601119963473.png

Output

atcodedog05_1-1601119978421.png

 

Hope this works. Please check and let me know.

 

Hope this meets the expection.

Pramod91
8 - Asteroid

Thank you so much for the help. It solves the issue.

Labels