Learn how to perform an approximate match equivalent of the VLOOKUP function in Get & Transform. The equivalent would be a series of conditional columns, and Oz shows how to make it happen.
- [Instructor] Let's look at the rarely used, but still important, VLOOKUP using true, or approximate match. When we use VLOOKUP using true, it's called an approximate match but it is not. You use VLOOKUP true, when you need to categorize things, or put them in tiers based on values, like grades. So, an 80 would be a B, right? That's not an approximate match.
That is a tiered match, is what we're about to do here. And in this case, we've got a league and each team can have a minimum of five players and a max of 10. And we're looking at our active teams, and over here, we've done a merge so that we have a master list of the active teams, their colors and the number of players. Now we need a column that tells us that team Cerberus has too few players, and the Minotaurs have too many players.
And we're going to do this by using conditional columns in getting transform, so let's go to a query that's already in this workbook. Show Queries, go to our merge query, Edit. So we've got three criteria that we want. Less than five, between five and 10, and over 10. Start our conditional column. Add Column. Conditional Column, Call this Tally.
If, number of players, is less than, five, then, Too Few. We're going to add a rule. If, the Number of Players, is greater than, 10, Then, Too Many. Otherwise, So this is asking us what to do with any teams that don't fit either of these two criteria.
Just have it say OK. We got it. Let's close and load this to the workbook. Here's our revised data. It just updated the Merge1 query that we already had, and we can confirm that team Cerberus does have too few players.
- What is Get & Transform?
- Querying data
- Working with columns
- Using formulas
- Pivoting and unpivoting data
- Grouping data
- Appending a query
- Merging/combining data with joins