Greetings:
I have a column with error messages (Message). I need to pick particular phase and add it to a new column (Error).
I tried using RedEx Tokenize - \w missing an as-built - the output looks like "s missing an as-built" which picks up letter "s" from previous word.
Also, I am not able to pick up "open commitment" from the next row. Should I be using another RegEx tool?
Message | Error |
123 is missing an as-built. This rule checks whether an as-built exists for a work order. | missing as-built |
546 has open commitment This rule tests whether an open commitment exists. | open commitment |
Appreciate your assistance.
Regards
Viji
Solved! Go to Solution.
If you are happy to write the different criteria then you could use a contains statement...
if contains([Message],"missing as-built") then "missing as-built"
elseif contains[Message],"open commitment" then "open commitment"
else "No error" endif
Alternatively, check out this post too: https://community.alteryx.com/t5/Data-Preparation-Blending/Using-IN-within-a-Contains-function/td-p/...
If this doesn't work perhaps I'm missunderstanding what you are trying to acheive :)
Ben
I have a macro in the gallery that allows you to put multiple "contains" arguments as an in-list option.
https://gallery.alteryx.com/#!app/Contains-In-List/5a5903fda18e9e2508e5ae0d
Try that and see if it fits your need.
Cheers,
Mark
Thank you, BenMoss. If Contains worked for me.
Thank you, MarqueeCrew. Downloaded your macro to try it out.