08-08-2017 09:38 AM - edited 08-03-2021 11:41 AM
Thisarticle is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Make Group Tool on our way to mastering the Alteryx Designer:
Did you ever play that party-game called 6-degrees of separation where you have to figure out how you are connected to someone famous in less than 6 relationships (or the movie version – 6 degrees of Kevin Bacon)?
All paths lead to... Kevin Bacon
Well that game just got a whole lot easier with the Make Group Tool!
The Make Group Tool’s job is to link together data into clusters where there is a link between them in data formatted as a table.
For example:
Bone | Connected To |
Head bone | Neck bone |
Neck bone | Shoulder bone |
Shoulder bone | Arm bone |
Using the Make Group ool, we can now prove (with just 1 tool) that all these bones are connected to the Head bone!
Bone | Connected To |
Head bone | Neck bone |
Head bone | Shoulder bone |
Head bone | Arm bone |
So – how is this useful in a practical case?
So you’re given as set of IDs - primary keys in a database table, and you need to bring these into your Alteryx canvas. However, there are several hundred thousand IDs, and running these as individual queries will take forever. Rather than run one query for each ID, you want to group these into continuous blocks!
We use a Formula Tool to add a column which is the number immediately after the one provided. We then use the Make Group Tool to find the groupings; and the Summarize Tool to find the largest grouping - which then gives you a substantially smaller number of queries (with a ‘from’ and ‘to’ value on each query).
Imagine you’re in charge of the social event in your company – and you’re trying to figure out if you’ve got disparate islands of people in the company who don’t know each other, or if everyone is connected to each other in some way.
OR
One way to find out is to make a list of who knows who, and then let the Make Group Tool sort out the connectedness question:
You can use the Make Group Tool for a range of other different applications – looking for connectedness in any graph (“graph” being used in the Computer Science sense of a set of points which are connected); assisting to find more fuzzy matches; or checking if there’s a connection between different types of products in various shopping baskets form an online retailer.
The common factor is where you have a from;to column pair, and are trying to find the grouping – the Make Group Tool is for you!
By now, you should have expert-level proficiency with the Make Group Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know atcommunity@alteryx.comif you’d like your creative tool uses to be featured in the Tool Mastery Series.
Stay tuned with our latest posts everyTool Tuesdayby followingAlteryxon Twitter! If you want to master all the Designer tools, considersubscribingfor email notifications.
The Make Group tool is my favorite Alteryx tool! I am in awe of the simplicity of it and aware of the power behind it. I've used it to group fuzzy match results where match sets are used to group business or personal names together. Also I've used it to understand ID merges. Imagine that you open an account and get assigned an ID and that over time you create multiple IDs. If later you find that these IDs should be merged it is simple enough to make ID 1001 merge with ID 9999. What if there were 2,3 or 4 other IDs mixed in?
ID |
Old ID |
1001 |
9999 |
1010 |
7777 |
7777 |
8888 |
1001 |
1010 |
8888 |
8989 |
How would your workflow handle the conversions if IDs that were the surviving values were also OLD values? If you are a SQL expert, try writing a query that will resolve this (remember, you don't know how many times to iterate when you start).
The Make Group tool "instantly" gets you to this result:
Group |
Key |
1001 |
1001 |
1001 |
1010 |
1001 |
7777 |
1001 |
8888 |
1001 |
9999 |
Best tool ever :)
Received, so this tool is mostly useful to find out and to make a list of who knows who
So, this could be an application on Facebook friend's mutual friends or showing friends of friends, etc.
Am I right?
Still not clear to me how does it works.
Great evergreen content here @SeanAdams , nice work!
Great examples but not very clear on how to use the actual tool and its configurations
Hi @Rhys_Cooper
Did you find the attachment to the original post? It shows the example and the underlying workflow where you only have to supply the tool with key1 and key2 fields.
Besides this attachment, you'll find the example workflow from within your very own Designer Examples (click on the tool and click on "Open Example"):
@RWvanLeeuwenThanks for pointing out that there was an attachment! I must have missed it.