Alteryx Designer Desktop Discussions

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

Conditionally subtract rows using Two Tables

dmc141
6 - Meteoroid

I have two tables, given as Table 1 and Table 2 below:

Table 1 and 2.png

 

 

Now, if for a given Code, there are values in Table 1 which match Table 2, then I want the rows in Table 1 to be subtracted using the rows from Table 2. For example for Code AAA, since Val1 = 100 in Table 1, then I must subtract 10, 20, and 10 from it to get the final value of 60. Similarly for AAA Val2, it is 200 - 5 - 30 - 50 = 115.

After this is done, I then want to merge the rows from Table 2 onto Table 1 such that I get the final table below:


Table 1 Final.png
I have also attached a sample excel file with the data
If anyone can help me with this it would be greatly appreciated, thank you! 

2 REPLIES 2
ntakeda
12 - Quasar

hi, @dmc141 

Summarize Table2 in Code.
Then, join it with Table1.
After that, perform the necessary calculations and UNION the results.

 

I will attach the workflow for details, so please check it.

2025-03-07_16h23_48.png

dmc141
6 - Meteoroid

@ntakeda Thank you again for your help - this is the second time you have answered my question in as many days, I greatly appreciate it!

Labels
Top Solution Authors