Alteryx Designer Desktop Discussions

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

Batch Macro with Dynamic Input

ganesamurthy
8 - Asteroid

Hi,

 

I am trying to read multiple files through batch macro but for some reason it is not reading all the files. I thought this is a simple one but I am unable to understand the root cause of this behaviour for not getting desired output! I am attaching data and worflow package for your reference.

 

Any assistance on this will be highly appreciated. Thanks!

7 REPLIES 7
JoeS
Alteryx
Alteryx

Hi @ganesamurthy 

 

I don't believe the dynamic input tool can work with wildcards. 

 

It needs to have the full path accessible.

 

If you change the process to pass through the full file path and update your dynamic input to use that. That should then work for you.

 

Thanks

 

Joe

 

Ps, there are lots of solutions in the challenge that you can see how they are done 😉

ganesamurthy
8 - Asteroid
@JoeS thanks for your response. Wildcard works fine when I tested Dynamic Input tool separately inside the macro. Also, I tried all other options without wildcard, even I replicated the same challenge solution inside this macro, but it didn't produce desired output! I am assuming it's to do with interface designer settings or something else that I am unaware of!

Kindly assist. Thanks.
JoeS
Alteryx
Alteryx

Hi @ganesamurthy 

 

So it does (you learn something new everyday!)

 

It looks like the issue you had was the settings in the dynamic input tool around modifying the SQL.

 

I changed it to these: 

Macro.png

 

And updated the formula to:

Formula.png

 

This then powers through them.

 

Another tip is to have the input file name as a field as well:

Input.png

ganesamurthy
8 - Asteroid

Hi @JoeS 

 

Though I had tried all these options before, I tried it again as per mentioned settings, but no luck. When I test it individually inside macro it always produces expected result for that particular input, but when I run it from workflow it only produces one row as shown below!

 

ganesamurthy_0-1572341889709.png

 

Sorry to bother, but your help on this will be much appreciated! Thanks.

danilang
19 - Altair
19 - Altair

Hi @ganesamurthy 

 

This may seem strange, but try connecting a browse to the output of the macro in you main workflow.  You're probably seeing a message similar to "1 iterations were run (ended by a downstream tool)" in your workflow output. 

d.png

 

It seems that the Alteryx engine only runs one iteration of a macro if the output isn't used in the main workflow since the data isn't needed anywhere.  If your macro doesn't output data, try removing the Macro Output tool from within it.

 

Dan

 

 

JoeS
Alteryx
Alteryx

Hi @ganesamurthy 

 

A batch macro will only run one batch if there are no downstream tools. If you add a browse to the output anchor that may be all you need.

 

Edit: looks like @danilang  beat me to it on the slow train WiFi!

🙂

ganesamurthy
8 - Asteroid

Thanks @danilang 

This did the magic!! New thing I learnt!

Labels