ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
The Alteryx Community is currently in implementation of the new SSO experience starting at 5pm MDT. PLEASE DO NOT POST ANYTHING. For more information, read the blog.

Alteryx Designer Discussions

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

Using a field list box to loop macro for each field

Jay_Felton
5 - Atom

I have built a macro that utilises the inbuilt macro Test of Means and the Summarise tool to output statistics on each field selected. Currently, within the macro workflow I have duplicated the calculation 10 times and created a dropdown box for each instance. A better solution would be to have one instance of the calculation and run the analysis for each field selected within a list box. How would I best implement this?

 

I assume the solution would involve transposing the fields to rows and use a batch macro. However, I do not know how to do this such that the macro only requires 1 input and 1 output.

 

Macro Configuration and Output:

Jay_Felton_1-1614569793900.png

 

Macro Workflow:

Jay_Felton_0-1614569772673.png

 

jamielaird
14 - Magnetar

Hi @Jay_Felton 

 

It's hard to see exactly what's going on in your macro from the screenshots but using your description I've put together a conceptual view of how I think you might want to approach this.

 

Batch macro for field statistics.png

 

The gist of it is that:

 

- your batch macro needs to process one field per run

- therefore the data needs to be transposed

- inside the macro, you can untranspose it to get back to the original data format

 

Let me know if that makes sense, and feel free to post up your workflow and macro if you'd like me to take a closer look.

 

Jamie

Jay_Felton
5 - Atom

Hi @jamielarid

 

Thanks so much for the swift solution. This diagram makes it a lot easier for me to conceptualise how to make it work. I'll give it a shot and see how I go!

Labels