Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Batch macro to loop through list of conditions

stephen787
6 - Meteoroid

hello everyone,

 

I'm trying to build a workflow to loop through a list of conditions and categorize my data by adding a column to the new data.

 

I can achieve this using a formula but I would like to use a batch macro if possible instead with input from a list of conditions. I have attached a list of sample conditions.

 

For example if field JC = a AND A = b AND JN contains c AND LD contains d then categorize as "Blue".

 

Could this be achieved using a batch macro? Does anyone have an example of how the workflow would look like?

 

Thanks!

4 REPLIES 4
AmrMansour
Alteryx
Alteryx

Hi @stephen787 ,

 

Love the second solution possibility that you are looking for. As we all know, one answer can be done with multiple solution workflow. 

 

Anyway, for the Batch Macro, I believe that one of the solutions could be a join between the Database and the conditions table. for each record from the database, the Join tool :Join: will find the right category in the condition table. 

 

PS. for the partial match you can use the Find Replace tool :findreplace:

 

Does that make sense?

 

Cheers

Amr

stephen787
6 - Meteoroid

Hi Amr , thanks for the reply.

 

The issue is that I want all 4 conditions to match to categorise the data. Can this be achieved using both the Join Tool and Find Replace tool only?

AmrMansour
Alteryx
Alteryx

Can you tell me if this workflow answers your question? 

 

here's a screenshot of the tools used in the Macro :

 

AmrMansour_0-1654095040936.png

 

 

Cheers

Amr

AmrMansour
Alteryx
Alteryx

Hi @stephen787

 

Does the solution work for you? 

 

If yes can you please accept it as a solution? It's very important for other members to know that a similar problem tread had been solved.

 

Cheers,

Amr

Labels