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

Multiplying two tables

anamik72
8 - Asteroid

I have two tables. Second table provides weights which are to be multiplied with every line in Table 1. I am sharing desired inputs and output. Can you help? Thanks

 

Table 1 Input  
CustomerLine itemAmount
AVolume30
ARevenue100
BVolume50
BRevenue

150

 

Table 2 Input 
ChannelChannel CodeWeight
Large150%
Medium240%
Small310%

 

Table 3 Output   
CustomerLine itemChannelChannel CodeAmount
AVolumeLarge115
AVolumeMedium212
AVolumeSmall33
ARevenueLarge150
ARevenueMedium240
ARevenueSmall310
BVolumeLarge125
BVolumeMedium220
BVolumeSmall35
BRevenueLarge175
BRevenueMedium260
BRevenueSmall315
1 REPLY 1
grossal
15 - Aurora
15 - Aurora

Hi @anamik72,

 

here is a quick way to do this:

 

grossal_0-1590253479889.png

 

What happens:

- The Append Fields generates all combinations - make sure to allow all appends

grossal_1-1590253517953.png

- We then use a Formula to generate the new Amount:

grossal_2-1590253556475.png

 

We have to remove the % sign in the end, therefore I use Left and the Length of the string -1 to get every character except the last one. We need to use "ToNumber" to convert it to a number and use it for the multiplication. Off course we need to divide it by 100, because we want our % back.

 

- In the end I remove the Weight column with the Select Tool.

 

 

Workflow attached. Let me know if this solved your problem.

 

Labels