Alteryx Designer Desktop Discussions

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

Iterative macro

avuong6
8 - Asteroid

Trying to automate my process with iterative macro:

 

right now it runs sql to look up a table and send output to sheet

avuong6_0-1682010989363.png

I want to connect this process to a worksheet that contains the names of the tables, change the table name referenced in the sql, output the data each time the table name is referenced.

 

added a macro input and set it up to pull from excel sheet with table names. 

 

how to connect macro tool to database sql so that it can change the names for each iteration?

 

avuong6_1-1682011298916.png

 

 

5 REPLIES 5
geraldo
13 - Pulsar

hi!

an example with macro.

 

 ymxd excel table names

yxmc macro with sql statement replace.

avuong6
8 - Asteroid

@geraldo 

thanks for the guidance. i setup things up like you example, when i right click i cant seem to convert to macro:

 

avuong6_0-1682024175354.png

When i add the macro tool, it doesnt connect to anything on the workflow. Where am i going wrong?

 

 

geraldo
13 - Pulsar

Hi,

 

I made an example using batch macro and not iterative macro. I am using the control parameter tool to receive the name of the table that is in excel

 

There are 2 flows, one yxmd and the other yxmc, which is the macro that allows you to change the tools. you will not follow change if this is not the way I made an example.

avuong6
8 - Asteroid

@geraldo 

ok, i was able to modify my workflow following your example and it works, but i really need it to make 2 concurrent updates to the sql code:

 

avuong6_2-1682438742145.png

 

in 1st iteration, it would update items in yellow

in 2nd iteration, it would update items in green

etc

 

i tried putting in 2 action tools, but it didnt work. any ideas on how to make this work?

avuong6_0-1682438504157.png

 

geraldo
13 - Pulsar

@avuong6 

 

I don't know how your sql is. I'll do an example update.
sql example

select Hireachy from dh_data_element

 

Update value in Hierarchy

geraldo_0-1682444127225.png

leave only the text you want to replace

geraldo_1-1682444232962.png

 

 

repeat this process in the other action update value tool.

 

geraldo_0-1682444390811.png

 

Labels