Alteryx Design Pattern: Tagging or Flagging What Rows to Keep or Discard
Use Case:
I have come across many scenarios where there just isn’t a nice simple clean way to filter on numerous columns AND records. Now if you read my previous post you learned about how to filter many different columns but what if you have a situation where there are a group of columns along with the need to look backward or forward (i.e. up or down records) and in which TOGETHER these elements provide the base to build logic for whether you want it in the data or not. The alternative being that you have to create multiple filters and or many tools to get to the same spot.
Something like:
IF
[Tomorrow] != 'Monday' AND
[AlcoholAvailable] = 'Y' AND
[Time] > 6pm
THEN
[Start Drinking] = 'Y'
ELSE
[Start Drinking] = ‘N’
ENDIF
Now, my friends, we have a good situation to use the Multi-Row Formula tool specifically for the purpose of tagging or flagging records for filtering based on relatively or truly complex logic. To be honest, it doesn’t even solely pertain to just using the multi-row formula tool because using the formula tool would work as well in many cases.
The important part here is making clear ‘flags’ to delineate your data. I can think of many useful examples where you would use the RegEx “Match” function even to look for something and then flag it for review, deeper inspection, or again for deletion.
Steps:
- Input Data
- Create logic you want to properly set a column value to T or F, Y or N, or even a value from a list of many
- Filter using that Flag you set