Alteryx Designer Discussions

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

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Developing a batch macro

6 - Meteoroid



I'm relatively new to the application.  I'm trying to do something that's probably not that complex by fumbling through it, but I've hit a bit of a wall and am hoping somebody might be able to point me in the right direction.  I think I'm fundamentally misunderstanding something, but I can't tell how far off I am.  


So my input is:  

[Group] [Period] [Value]


I want to do ABC classification of Groups by Period.  So if I wanted to just be hacky, I could just just use redundant branches of filters to break it out by period calculate my ABC's and move on to whatever's next.  But since this is something that I could see myself using in the future, I thought I'd try to come up with a better way to do it.  


My expected output would be something like:  

[Group] [Period] [PX_ABC] [PY_ABC] [PZ_ABC]


And yes, I get that based on this I would get some jagged data like:  

[Group] [Period] [PX_ABC] [PY_ABC] [PZ_ABC]

A           X              A

A           Y                              B


But I'll clean it up on the other side.  


So I made out my batch macro here:  (mostly from watching this video:


The control parameter should be influencing the macro by updating the filter step which should select only the current period in the iteration.  It should also change the output field name later on in the workflow.  


In the actual workflow I feed the macro tool the aggregated data described above and a distinct list of periods.  


So the problem:  

My output only includes one of the expected fields.  PX_ABC based on my dummy explanation, but not PY_ABC.  Though, if I check the log from the workflow the batch tool does output that it's run through the expected number of iterations, I just don't see it in the output.  



I guess some possibilities that I'm not sure how to troubleshoot out:  

-I really haven't configured this macro correctly as far as the controls go.  


-I am expecting that for each iteration of the macro it will add another field to the output.  Maybe it doesn't really do this?  


-Along the same lines, a lot of the calculations for the ABC piece just have generic names - like the running total and the %Of calculation.  For these purposes it's a throwaway, so I don't really care, I"m just assuming they're getting added per the macro.  


-I expect that my iterations just append at the end.  Like my P1 stuff should just stack on to my P2 stuff.  I haven't configured anything to tell it to do that so maybe there's something additional I need to add.  





A batch macro is a special kind of macro that is typically needed to process a group of records based on a control parameter. The control parameter determine...
17 - Castor
17 - Castor

Hi @danloz 


Macros are tricky to make and can be even harder to debug.  Can you provide your macro as it stands now and some sample data?  Include you input data and what you're expecting as the output.  That will make tracking down the issue much easier.



6 - Meteoroid

You know what:  I totally appreciate it but I think I figured it out.  


-My control parameter table only had 1 column.  I think it needs 2.  

-I was trying to use an action tool to do more than one thing

-I don't know if the macro tool can dynamically add a field to the data. 

-Also my output concept was kind of idiotic and I should haven't tried to do that anyway.  


So I made what amounted to minor changes in front and changed my output expectation to simply

[Group] [Period] [Result]


I also added to the output the control parameter which made me feel better that things were happening the way they were supposed to be.  That seems to help a bit as well.