Alteryx Designer Desktop Discussions

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

String to Formula Calculation

arshadsaad
6 - Meteoroid

Hello, I'm new to Alteryx and I wanted to calculate values based on a formula (in string form). 

 

I did some research and the Dynamic Replace method has been proposed but even after looking at the documentation and the tool mastery article, I still can't manage to make it work. 

 

I'm attaching a sample of the data I'm working with. 

 

I need to calculate a TOTAL COST based on the formula in the "formula" column. 

 

It would be great if someone could please help me understand what I need to do.

 

 

 

6 REPLIES 6
FrederikE
13 - Pulsar

Hey @arshadsaad,

 

You could probably do it using a batch macro, just because this allows you to transform a string into a formula, not bc. you'd need the real batch function. But that is a very unusual use case of Alteryx. 

 

See the attached WF

TimN
13 - Pulsar

TimN_0-1667580545339.png

 

I'm still learning this tool but how about this...

 

 

Hi @arshadsaad 

 

You can perhaps use the "Dynamic Formula" tool that's part of Crew macros http://www.chaosreignswithin.com/p/macros.html

 

I used it and it seems to be working. See below and attached.

christine_assaad_0-1667582989096.png

 

Hope that helps. Cheers!

TimN
13 - Pulsar

Here's a better version.

 

 

 

Felipe_Ribeir0
16 - Nebula

Hi @arshadsaad 

 

One way of doing this using the dynamic replace, take a look at it :):

 

Felipe_Ribeir0_1-1667782204823.png

 

 

Felipe_Ribeir0
16 - Nebula

Hi @arshadsaad 

 

It worked?

Labels