Alteryx Designer Desktop Discussions

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

help with joining records

prravich
7 - Meteor

Hi all,

I am new to alteryx and I have two data tables shown below, vendor and sales.

datevendorexpense
1/1/2001A10
1/1/2001B10
2/1/2001A20

 

datesales
1/1/2001100
2/1/2001150
  

 

I need the following output .Can someone please guide me which tools I need to use to get the desired result?

 

datevendorsalesexpense
1/1/2001a10010
1/1/2001b10010
2/1/2001a15020
2/1/2001b1500
5 REPLIES 5
JohnJPS
15 - Aurora

Hi @prravich,

The attached should accomplish this. This uses the Unique tool and AppendFields to ensure that all vendors are present for all dates. From their the Multi-Join tool does a great job of joining in such a fashion that it provides exactly the output your going for; the final formula tool just turns null fields in from the join to zero counts.

Capture.PNG

Hope that helps.

michael_treadwell
ACE Emeritus
ACE Emeritus

 So at first glance this would just be the job of a simple join.

Join table A to table B to get you output table.

 

However, the complication arises when you need to generate missing data for vendor B on 2/1/2001. I've used summarise and append to do the job. I've attached a workflow showing both the simple and more complex example.

prravich
7 - Meteor

Thank you so much. This works great

prravich
7 - Meteor

Thank you Michael, this works as well

DultonM
11 - Bolide

@michael_treadwell and @JohnJPS....you guys are just too quick.

 

I've attached a workflow that is much like Michael's but has a slight reordering of the tools and a description of why each tool is there. I also converted your date field into the Alteryx date format with the DateTime tool so that you could down downstream date calculations.

Labels