Alteryx designer Discussions

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

Compare two sets of data and subtract one from the other

5 - Atom

Hey folks - first question on the forum.  I have two sets of summary data with almost the same headings and rows for example;

 

Set 1

NameAirHotel
Joe200100
Mary250100

 

Set 2

NameAirHotelGround
Joe400250100
Jane400100 
Mary50025050

 

I want to compare or join the data then subtract the data from Set 2 from the data in Set 1 to get a net result for Set 3:

 

Set 3 (Set 2 less Set 1)

NameAirHotelGround
Joe200150100
Jane400100 
Mary25015050

 

Thanks for your help!

Highlighted
11 - Bolide
11 - Bolide

Hi @steeldad 

 

There are two methods to do this, both attached here (and picture below). Both involve joining the data sets. The first is quicker/simpler, but isn't dynamic to how data might change in future (e.g. new columns being added); my preference would be method two (the second container) which transposes the data first, so we can join on the name (e.g. Joe) and field name (e.g. Air) and then just compare numbers side by side dynamically. 

joins.PNG

 

 

Hope this helps! 

 

Andy

Highlighted
5 - Atom

Thanks Andy!

Labels