Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Regex Parse Expression Not Updating with Listbox and Action Tool for Macro

tstowell
7 - Meteor

I don't know if anyone has ever run into a problem like this. I have tried every different configuration of the listbox by manually inputing my names and values or doing it in an external input (excel sheet). Whatever I do the value won't update in the regex parse expression when I run my macro. It just reverts to the default value that was in there when the macro was configured. If anyone can help I would appreciate it. Thanks!

 

tstowell_0-1652573008486.pngtstowell_1-1652573040250.png

 

tstowell_2-1652573057615.png

 

16 REPLIES 16
tstowell
7 - Meteor

I can provide an example of the txt file in a little, but it comes in one column as a long string of text. I know how many fields need to be in each column and that’s why I do the (.{5}). I want it to break it into 29 (or however many) different columns. I don’t think one big expression or column would work.

tstowell
7 - Meteor

@DataNath Hello! I am attaching an example I created with my problem. The summarize contains the regex string that I am trying to put into the regex tool with a list box. I know all of the regex strings that I need and that is why I can manually fill in the list box, like we discussed before, the problem is the number of fields for the different data changes. I found a soultion by just getting rid of the list box option and just doing different input nods on the macro tool, so if you don't find a solution it is perfectly okay. Thanks again for helping. 

DataNath
17 - Castor

Hey @tstowell, cheers for this! Have had another look and really can't beat this one. There's no options for dynamically changing the number of capture groups so unless somebody can find a genius workaround I think we'll have to stick with your solution!

tstowell
7 - Meteor

All good, that’s what I thought! Thanks again!!

DataNath
17 - Castor

Apologies for digging up an old thread here.

 

@grossal - took a good chunk of digging but finally found it. Not fully refreshed myself on the problem but I believe this relates to what we were discussing!

apathetichell
18 - Pollux

I don't think what you are trying to do will work - at least not that way.  Let's take a step back at what you are doing:

 

1) you have you original workflow - a field has a single regex marked group which is parsed to a single new field.

2) You have a drop down - with 19 marked groups - these will presumably create 19 new fields.

3) Your action tool is set to update the 1 marked group with 19 new marked groups.

 

This does not work. You need to do two things - 1 update the regex expression. 2 - create new fields for each of those groups. You cannot do 2 - with a second action tool (perhaps editing the raw xml - but probably not worth it).

 

Does this mean you cannot do it? There's probably a way - I'd use a batch macro. In a batch macro you would use a regex_replace in a formula tool where you would basically identify which marked group (1-19) you were looking to extract from your field. You would then rename the field. You would then set it to union by name. Then you'd probably to clean it of some nulls().

 

 

apathetichell
18 - Pollux

I was thinking about this - and really this should be done by a detour/container/macro - with a regex tool configured for the additional marking groups. Your dropdown should be triggering that tool - not replacing the characters in that tool. This would prevent the schema additions that parsing n marking groups vs 1 marked group create.

 

 

Labels