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

Alteryx Designer Desktop Discussions

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

HOW TO CHANGE FORMAT?

JustynaMZ
7 - Meteor

Hi,

 

I have a table (example below)

I want to create column (called RESULT) which is a sum of columns a,b,c,d,e,

For this purpose I used Formula tool and put there instruction:

[a]+[b]+[c[+[d]+[e]

I received an error 'Type mismatch in operator +'

My assumption is that it is because of data format in a,b,c,d,e (VString and Double). 

Can you please help me how to solve this problem?

I do not want to use ToNumber as in my real table I have around 30 columns that I need to add to receive the 'RESULT'

 

Thanks in advance for your help!

 

 

 

aaabbbcccdeRESULT
10nn1ww5we112?
12oo2ww6wqw113?
11oo3ww7wew1133?
14ooo4we8wert1122?
4 REPLIES 4
AngelosPachis
16 - Nebula

Hi @JustynaMZ ,

 

Can't you use a select tool before that formula tool to change the data type to numbers for all columns included in that expression?

 

The select tool will allow you to change the data type from a dropdown list, so changing al V_String to  Double should be enough

markcurry
12 - Quasar

Hi @JustynaMZ 

 

There's a workflow with some options, I take it that the Dynamic Select won't work, if your numeric fields aren't set as numeric data types, but the top option should work for you....

pedrodrfaria
13 - Pulsar

Hi @JustynaMZ 

 

If you do not want to use the ToNumber, your only option pretty much is to manually change the columns to the double format with the Select tool and change it back afterwards.

 

However, be careful because the moment you change it from string to double, whatever does not fit in the double format will become null, so you may lose important data and not realize it.

 

I believe the best method is to definitely use the ToNumber(), it would be a quite large function, but it would make sure you did not lose any data.

 

Pedro.

Qiu
21 - Polaris
21 - Polaris

@JustynaMZ 

We need something dynamic

0216-JustynaMZ.PNG

Labels
Top Solution Authors