Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Dynamic Select in Conjunction with Macro

TomBock
8 - Asteroid

Hello:

 

I'd like to get some assistance with improving a *sample* process including a DYNAMIC SELECT.

 

Here's what I currently have:

- TEXT INPUT tool containing six fields

- Each of the fields include prefixes such as {FF, LK, Other}

- Now, for the 2 prefixes = {FF, LK) I have added a DYNAMIC SELECT each... followed by an OUTPUT (into the same MDB database).

 

Current Process:

- Upon executing the workflow, 2 tables (one for FF fields and another one for the LK fields) are added to the MDB database.

- Given that I do NOT have another 3rd DYNAMIC SELECT, the field [Other_Something] does not get output at all (as expected).

 

My question:

- I may have additional prefixes beyond "FF, LK, Other", so I do NOT want to add a DYNAMIC SELECT for each of the field prefixes.

- How should the workflow be modified so that all fields (including those that may contain a 4th or 5th prefix) are added into their respective tables?   Maybe via a macro?

 

Thank you,

Tom

 

DynamicOutput.JPG

 

6 REPLIES 6
danilang
19 - Altair
19 - Altair

Hi @TomBock 

 

I think you're right about requiring a Macro.  I can't see any other way to do this.

 

danilang_0-1687278443176.png

The main workflow uses a Field Info tool to extract the column, extracts the prefix for each column and summarizes the prefixes to pass to the Control parameter of the batch macro.

danilang_1-1687278575914.png

The batch macro uses the prefix in the control parameter to modify the Dynamic Select formula and also the Table name in the Output Data tool.

 

Dan

 

 

TomBock
8 - Asteroid

@danilang -- hi -- thank you for the assistance.   This solution looks very promising.

 

I re-created your main workflow (see attached) but ended up getting an error on the batch macro.   See attached JPG.

 

What am I missing wrt the config of the control parameter (5)... where I chose "NAME"?

 

Error.JPG

binuacs
20 - Arcturus

@danilang excellent solution as usual!!

 

@TomBock No update is required to the group by tab, update the questions tab and select the Name field

binuacs_0-1687296156231.png

 

TomBock
8 - Asteroid

@danilang , @binuacs :

 

thank you for the continued support... I appreciate it.

 

Allow me to recap:

- The macro now executes w/o any errors.

- For testing purposes only, I added another field (e.g., "Test_XYZ") into the TEXT INPUT tool and a 4th table "Test_Table" is added to the MDB file... GREAT!!

 

However, in the MDB output, all tables (whether FF_Table OR LK_Table OR Other_Table OR Test_Table) contain only the same 2 fields: [LK_LASTNAME, LK_GENDER].  See attached JPG.

 

How would the macro have to be modified so that the respective fields (e.g., FF_CASE_NUMBER, FF_AGE, FF_Summary) would be automatically added into table [ FF_Table]?  Sample applies for all remaining fields where field prefix indicates into which table the fields need to be inserted.

 

Thank you,

Tom

 

FieldOutput.JPG

danilang
19 - Altair
19 - Altair

Hi @TomBock 

 

Sorry.  There was a typo in the replace string for the Dynamic Select in that it included an extra space.  It's fixed in this version

 

Dan

TomBock
8 - Asteroid

@danilang -- PERFECT!!!!   Your solution works 100% as envisioned.   Many thanks!

 

@binuacs -- thank you for the comment earlier... it helped me w/ the error issue (macro wasn't executing).

Labels