Alteryx Designer Desktop Discussions

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

Multiply multiple columns by a respective number

dpowers
5 - Atom

Hi. I have a dataset where I need to scale every column's values by a multiplier so that it ties to other data.

 

Currently I have two sources.

 

1) Primary data which looks like this:

Store NumberLocationRevenueCostsMarketing ExpenseDiscount...
1A####...
2B####...
3C####...

 

2) A multiplier key which looks like this:

Revenue0.97
Costs0.88
Marketing Expense1.12
Discount1.07
......

 

I'm looking for the least resource intensive way to multiply all of the Revenue column by the Revenue multiplier, all of the Costs column by the Costs multiplier, and so on (30 columns in total).

 

I've seen solutions which may work using Append Fields, but my data is millions of rows by 30-40 columns, so I'm afraid that would balloon my data severely. 

 

Through my searches I haven't found anyone with a similar issue. Do you have any thoughts on a solution?

7 REPLIES 7
ArtApa
Alteryx
Alteryx

Hi @dpowers - This is what you can try:

ArtApa_0-1680738392035.png

 

Qiu
20 - Arcturus
20 - Arcturus

@dpowers 
I tried an quite not-so-normal by bring the multiplier key to the column name.

But need to make the the Field Name and order to be consistent for two data streams.

0406-dpowers-alix-A.PNG0406-dpowers-alix-B.PNG

SPetrie
12 - Quasar

Dynamic replace could be another option.

Use the field info tool and a standard find/replace to determine what multiplier to use on which field, and then a dynamic replace to apply those formulas to each field.

 

SPetrie_1-1680752297841.png

SPetrie_2-1680752343673.png

SPetrie_3-1680752367937.png

 

 

 

 

Qiu
20 - Arcturus
20 - Arcturus

@SPetrie 
This looks nice.
I am always not quite undersanding the Dynamic Replace, this is good sample. Thanks.

SPetrie
12 - Quasar

Thanks @Qiu 

I recently started using it more and am still getting used to it myself. Its my newest hammer, and every problem looks like a nail now. :)

dpowers
5 - Atom

@SPetrie and @Qiu thank you for the quick replies. I'll try SPetrie's option first and report on its success!

dpowers
5 - Atom

@SPetrie this was exactly what I needed, thank you!

 

To anyone referencing this in the future, be sure to download his example workflow to see the configurations at each step

Labels