Need help in assigning a group to a set of data using a range of values. The groups and ranges are defined in data set #1. The values (names) are defined in data set #2. How do I have Alteryx evaluate the group ranges, look up the values based on last name in data set #2, and produce the resulting data set below?
Data Set #1
Group | From | To |
A Thru L | A* | L* |
Halperin Thru George | Halperin | George |
A Only | A* |
Data Set #2
First Name | Last Name |
Patrick | Anderson |
Tyler | Bruce |
Albert | Felts |
Emma | Halo |
Sarah | Halperin |
Freddy | George |
Anne | Jackson |
Terry | Myers |
Brandon | Taylor |
Resulting Data Set
Group | First Name | Last Name |
A Thru L | Patrick | Anderson |
A Thru L | Tyler | Bruce |
A Thru L | Albert | Felts |
A Thru L | Emma | Halo |
A Thru L | Sarah | Halperin |
A Thru L | Freddy | George |
A Thru L | Anne | Jackson |
Halperin Thru George | Sarah | Halperin |
Halperin Thru George | Freddy | George |
A Only | Patrick | Anderson |
Solved! Go to Solution.
Just for clarification, if there is a wildcard, it just returns everything starting with the given characters; but if there is no wildcard, then it needs to return find the row matching the first LastName, and the row matching the second last name, and return all rows in between, regardless of alphabetization? (In the example provided, Halperin is alphabetically before George so an alpha match would never return rows... if we fix it a grab from George to Halperin, we would also get Halo in the result set).
The attached solution works using an alphabetical selection, not using a row-wise approach, which is, I'm hoping, what you're after:
Hope it helps either way!
- John
Thanks johnjps! Yes, my brain wasn't working right when mocking up the data. The routine you provided solves my issue!!