Hello,
I need to parse to a column, every time a product code appear.
The product codes have this format:
SKU 0726709 ("SKU" + 7 numbers).
Here is an example.
Thank you
Solved! Go to Solution.
hEY @BautistaC888 !
Use a formula tool with this formula below:
IIF(REGEX_Match(REGEX_Replace([Product], ".*(SKU\s*\d+).*", "$1"), "SKU\s*\d+")=-1,REGEX_Replace([Product], ".*(SKU\s*\d+).*", "$1"),Null())
Hope that helps!
Hi @marcusblackhill - FYI - Regex_Match can return boolean values (despite what you may have heard on an otherwise wonderful Alteryx Academy video on regex) so:
IIF(REGEX_Match([Product], ".*SKU\s*\d{7}.*"),REGEX_Replace([Product], ".*(SKU\s*\d{7}).*", "$1"),Null())
is the same as yours... no reason for the unwieldy "=-1" part...
Thanks @apathetichell !
Actually It's just the custom to work with returns to see better the definition hehehe But yeah, don't really need that part because is boolean already.
If unfamiliar with Regex or if challenging, a tool-based (though less-efficient) approach also works..
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |