Alteryx Designer Desktop Discussions

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

Cross reference based on multiple columns

l_blumberger
7 - Meteor

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:

IDStore
1a
1b
1c
1a

 

Table 2:

RowIDOriginDestinationDistance
1aa50
2ab40
3ac100
4ad70

 

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:

IDOriginDestinationDistance
1ab40
1bc60
1ca100

 

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!

2 REPLIES 2
jgo
Alteryx Alumni (Retired)

Hi @l_blumberger,

 

Would the attached workflow solve what you're trying to accomplish?

JohnJPS
15 - Aurora

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!

Labels