Alteryx Designer Desktop Discussions

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

Split function in Formula Tool or any equivalent - multiply values from text

gregx
8 - Asteroid

Hello,

I have values in text field for example:

"1#2#3.3#-4.9"

I would like to multiply all values separated by #, so in this case it would be 1*2*3.3*(-4.9).

Is there any function that can handle it?

Just to add - Text to Column won't work as the number of items in the text may vary (may be 1, may be 20, there is no rule).

 

6 REPLIES 6
Christina_H
14 - Magnetar

There isn't a simple formula for this, although I think you might be able to use Dynamic Formula from CReW macros.  Here's a way to do it.

Christina_H_0-1677672811395.png

It does rely on # being the only symbol included that can't be converted to a number.

binuacs
20 - Arcturus

@gregx One way of doing this

binuacs_0-1677673010479.png

 

Christina_H
14 - Magnetar

Actually, it looks like a simpler way to do this is on the way.  This suggestion was recently accepted: Add Product to Summarize tool - Alteryx Community

suby
11 - Bolide

Hi Christina, 

 

Could you please explain the expression in multi row formula on what it does?

suby
11 - Bolide

HI Binuacs,

 

Could you please explain the expression in multi row formula on what it does?

Christina_H
14 - Magnetar

The expression is taking the Product from the previous row (grouped by ID in case you have more than one expression), and multiplying it by the value on the current row.  If the previous row has no value (first row for that expression) it substitutes 1 so that the product will still work.  It's calculating the equivalent of a running sum but with multiplication, so when you get to the final row all values have been multiplied together.

Labels