Hello,
I have a workflow, where I need to filter by number and perform certain functions after that. I would like to incrementally update the filtered number, i.e. Tile_Num+1 so that the process runs incrementally and gives the results. I tried using update from macro but did not get success. Is there a sample workflow which i can refer to.
Thanks
Solved! Go to Solution.
Hi @Begnuser123,
Is there a particular number you want to increment up to? Perhaps a max number in your data set?
I see there being two possible solutions, converting to either a batch macro or an iterative macro.
Batch Macro Approach:
Works by passing a unique list of "numbers" you have into the batch macro one by one (running the workflow once for each number). We use the control parameter tool to pass the list into the macro and an action tool to define how the list interacts with our workflow, in this example i'm passing that list into the filter tool to change the number we're filtering for on each run.
Workflow:
Macro:
Iterative Macro Approach:
Slightly more complex, and probably not the approach i'd take unless you feel comfortable with them. This method increases the starting value we are filtering for by 1 each time the macro loops using the [Engine.IterationNumber] variable (available in iterative macros). It will keep looping until the variable has reached the maximum number available in your data set to filter for.
Workflow:
Macro:
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
Hi @Jonathan-Sherman ,
Thank you for the solutions.
The batch macro approach though convenient does not suit the purpose as everytime i need to input the number.
The iterative macro approach looks good. I tried to replicate in my solution but was getting errors on using similar to sample macro.
I have attached a workflow using sample data. The workflow is to find out countries not present in every region and load the data of all regions to an excel. Please help to add the macro in the workflow.
Thank you in advance.
Hi @Begnuser123,
I don't think you need to use a macro in this case, you could simply scaffold the data (combine a list of regions with a list of countries) and join on region and country to find the missing ones (which in my case fall out the right side of the join.
I've added my suggestion under your workflow so you can see the difference, we still retrieve the same list of 25 missing countries for Region1.
If this solves your issue please mark the answer as correct, if not let me know! I've attached the updated workflow for you to download if needed.
Regards,
Jonathan
Thank you @Jonathan-Sherman . This works