SOLVED
Cross reference based on multiple columns
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
l_blumberger
7 - Meteor
05-31-2016
10:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
As in the example below, I have table 1 with ID numbers of visitors and the pattern of stores they visited and table 2 with the distance between every combination of stores.
Table 1:
| ID | Store |
| 1 | a |
| 1 | b |
| 1 | c |
| 1 | a |
Table 2:
| RowID | Origin | Destination | Distance |
| 1 | a | a | 50 |
| 2 | a | b | 40 |
| 3 | a | c | 100 |
| 4 | a | d | 70 |
I need to add the distances from table 2 into table 1 depending on the patterns of stores visited. Ideally, the resulting table would like:
| ID | Origin | Destination | Distance |
| 1 | a | b | 40 |
| 1 | b | c | 60 |
| 1 | c | a | 100 |
I may need to do some rearranging of table 1 and something like a vlookup to reference table 2, but I am unsure of the best method to use. Any suggestions would be helpful.
Thanks!
Solved! Go to Solution.
Labels:
- Labels:
- Join
- Preparation
- Transformation
2 REPLIES 2
jgo
Alteryx Alumni (Retired)
05-31-2016
11:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
JohnJPS
15 - Aurora
05-31-2016
11:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Not sure this is "correct" but I attached a workflow which:
- Uses a MultiRow formula to generate the "Dest" column based on the following row's store (grouped by ID)
- Generates a lookup key based on translating "b to a" to "a to ba" based on a < b, (so the join will work if Orig is "b" and Dest is "a")
Then just joins... hope it helps!

