Hi All,
I have this set of data that I need to extract IDs from, it can be alphanumeric. Here's a sample:
Rule: The rule Alteryx needs to consider to extract the ID I need
Input: Sample of Input Data that I will be extracting data from, it can be dynamic and number of digits might change
Expected Output: the sample extracted data from the Input sample
This set of rules might change and expand. So I was thinking to keep a database that I can add more rules into and then Alteryx can read that and apply to the IDs if that rule is use etc, but I am confused how to do it. Regex? Formula? Find and Replace?
Rule | Input | Expected Output |
NIL | 11125685 | 11125685 |
Before first underscore (_) | 242370611_s200760_f200796 | 242370611 |
After dash (-) | D-998344637 | 998344637 |
After second dot, before last dot (.) | 0.3.3900356.1 | 3900356 |
Before dash (-) | 4241-1 | 4241 |
After colon (:) | 00OB7MM2F1NCSSNA296282:296282 | 296282 |
Before underscore (_) | 182474_2-S | 182474 |
After underscore (_), before last dot (.) | 0.47.3_3902755.1 | 3902755 |
You might be able to accomplish this by dynamically generating a formula in the Formula Tool. In turn, you might have to use a Batch Macro to be able to do that, as demonstrated in this solved question.
I see this as nested IF-THEN statements: IF [Condition] THEN [Action].
Thank you, I will check and update this thread!
hi, may I know if this can work with a dynamic replace?
@karizze_fitzgeraldine Are you thinking of modifying the formula in the Formula Tool using Dynamic Replace? I don't think that works because the Formula Tool will do its thing first before going to Dynamic Replace, at which point it's too late for Dynamic Replace to do anything.
The changes/update to the Formula Tool must happen dynamically before or while it executes, which, as far as I know, can only be done by the Control Parameter Tool and similar stuff under the Interface group of tools.