Alteryx Designer Desktop Discussions

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

Table Look Up with different criteria

newbiealt
5 - Atom

Hi, I have a look up table where the criteria are not the same for entries. 

For example, for Type A data, it needs to look up by Type and Category; while for Type B to Type D data, it needs to look up by Type only, it doesn't matter what the Category is.

May I ask how to achieve this in Alteryx?  Thanks!

 

Lookup table example

TypeCategoryValue
AShopping1.5
ADining2
B*3.5
C*1.5
D*3

 

Data example

IDTypeCategoryExpected Output Value
1AShopping1.5
2ADining2
3BShopping3.5
4BDining3.5
5CEntertainment1.5
6DEducation3
1 REPLY 1
DataNath
17 - Castor

Hey @newbiealt, how does this look? We first of all just do a join based on the 2 fields to find the most granular matches that we need. Any that fail to find a match i.e. only join on Type, we just use a Find Replace to lookup the Type and append the relevant value. After that we just Union the two sets of results to get the whole table back together:

 

997.png

Labels