Alteryx Design Pattern: Using Data to Create a WHERE Clause or IN Statement
You have a long list of items that you want to filter your SQL query down to for better performance. It can be difficult and painful to have to type many values. Fortunately you can use this solution to speed that up. The added benefit is that you can use this to create a value list for an IN statement in the formula tool as well. A note of caution here is that sometimes this problem can be better or more easily solved by using a Join to do the filtering, just depends on a case by case basis.
- Input Data
- Group By List Field (To get unique values)
- Summarize tool with Concatenate
- Place “Where” or IN” in Start box of Concatenate
NOTE: Make sure you look at your data and if there are values with a single quote that you use double quotes and vice versa