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

Batch Macro error handling

ValM
6 - Meteoroid

I have a batch macro that makes calculations on a set of 3 fields. The trios are fed into the macro, macro calculates and logs results for each set of 3, one under the other.

The problem is that my set of fields sometimes are incomplete, instead of feeding the macro the 3 fields, only feeds 2, or 1. In this case I would like the macro to ignore that set and continue with the rest.

As of now, these errors means that the macro doesn't give any output.

I looked into detours, but it don't know how to feed the route to the detour.

I tried a filter, which is what I put in the sample workflow, but makes no difference.

I am attaching a small work flow with sample of data and the  part of the macro that would need to have the error handler.

Any suggestion will be greatly appreciated!!!!

Thank you!

 

Screen Shot WorkFlow.JPG

11 REPLIES 11
gabrielvilella
14 - Magnetar

If you have a table with all the field names, but no rows, you can ensure they are all there. Then maybe you can have some extra condition after the summarize to determine what needs to happen.

ValM
6 - Meteoroid

Thank you so much @gabrielvilella !!! That was a great idea, but I still don't know how to avoid the macro going into certain branches that require data for Field 1. I added an example in the workflow. I linked to iteration 1 so you can see it working.

gabrielvilella
14 - Magnetar

No problem! What needs to happen if there is no Field 1? Maybe the detour will be the way to go. If you could please insert a branch for when there is no Field 1 would be helpful. 

ValM
6 - Meteoroid

The version 3 I uploaded on my reply has one of those branches. Let me know if you cannot see it. This is my first time posting, so I may have messed it up  :p

gabrielvilella
14 - Magnetar

So, I did this to test iteration 2. I can see the nulls. Should the data go forward to the container 5?

gabrielvilella_0-1646942835891.png

 

ValM
6 - Meteoroid

Data wouldn't need to go forward to Container 5.

 

Screen Shot WorkFlow 2.JPG

ValM
6 - Meteoroid

Ideally, once we know that there is no Field 1, should stop calculations. Calculations would be inaccurate anyway, but , if we figure out a way to stop the macro from failing, I could add a message in the output to ignore results. Not ideal, but would still help.

gabrielvilella
14 - Magnetar

I see you have a control parameter called Field 1. Can the data from this control parameter be used to determine if the Field 1 is present or not? If so, you can use that data to determine the direction of the detour. Here is an example.

ValM
6 - Meteoroid

With that control I pass the Name of the field, and I pass the name of the file to look in. Inside the macro that name may or not be found in the file. Hence we only know if the field exists inside the macro. The condition would need to be in between reading the data and the calculations.

 

I was hoping to only have the macro opening the file once grab the data and do its stuff.

 

I suppose I could check the existence of the full sets before I run the macro and run it only on pre-vetted trios.

This means I have to open the file before calling the macro and in the macro.  (right now, like I said, I only pass the name and use a dynamic input within the macro). Not the end of the world :)

 

If you can't think of a better way, I will go with that. 

 

Screen Shot WorkFlow3.JPG

 

 

Labels