Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Converting a string with operators to value

oaingo
5 - Atom

Hi guys - in Alteryx - how do you convert a string with operators into a value?  Basically my data comes in as a string with a operators  and I want it converted to a value . 

 

Eg:

 

15 + 45 + 10 + 5 should be 75

 

Thanks so much.

4 REPLIES 4
Emil_Kos
17 - Castor
17 - Castor

Hi @oaingo.,

 

You need to use select tool or auto field tool.

 

https://help.alteryx.com/current/designer/select-tool

Ben_H
11 - Bolide

Hi @oaingo 

 

Do the operators vary? That is, might you get 10 + 40 - 5? As that would be a bit more complex?

 

I've attached a simple way of doing it if you are always summing the result to give you an idea.

 

Regards,

 

Ben

oaingo
5 - Atom

Currently, I only need to use 1 operator +. Please give me ideas if I use operators vary

Many thanks

Ben_H
11 - Bolide

Hi @oaingo,

 

If your operators are going to vary then it becomes more complex.

 

Including subtraction is pretty straight forward, but getting into multiplication and division you need to consider the order of operations.

 

I've included a basic routine that will do addition and subtraction to give you something more to look at. If you want to add in multiplication etc. then think about how you group your values and the order you would apply your operations.

 

Regards,

 

Ben

Labels