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!

Need a macro to push specific records through in a batches for spatial analysis

7 - Meteor

Hello - I'm having trouble figuring out how to solve a spatial analytics project.  I have created a basic workflow with example data.  The business problem is I want to look at business activity for specific dealers on a certain day (July 21st in my example, but would be dynamic in the final product).  I want to compare the transactions for dealer Alpha to the other transactions for Alpha...and then the same for Beta's July 21st transactions to the other Beta transactions.  Ultimately, I'm trying to verify a dealer's recent transactions are occurring within close proximity (currently set as 0.2 miles) of the past transactions for the dealer.  The workflow I created compares the transactions for July 21st for all of the transactions (that weren't on July 21st).  I'm thinking I need a Batch Macro to do it and only pass the transactions for a specific dealer at a time to run through the Find Nearest tool.  I'm thinking the final output would be any transactions that didn't match within 0.2 miles of any prior transactions...then we could review those to determine if it a new location for the dealer or another reason for the new location.


Hi @byagelski ,


I was able to create such a macro by taking your example, and having it repeat in a batch macro with a filter for the vendor.

It runs each time on the data, filtering to the vendor you want every time it runs.


spatial workflow.png


This can be made even simpler by removing the Question input and choosing the Vendor column as the batch macro's grouped input (my example doesn't group the input).

spatial macro.png





7 - Meteor

Thanks Joe, this is really helpful.  Eventually I'll be automating this to run each day looking at yesterday's transactions and comparing to the previous 180 days.  How do I get around selecting the vendor field each time?  Should I switch to an iterative macro that counts how many vendors had transactions yesterdays and then only sends those to the target of the Find Nearest tool?

7 - Meteor

Thanks again Joe.  I was able to work through your example to adjust to make it dynamic for my needs.  I hadn't worked with the Control Parameter tool before now.  This is a really powerful use case for us and I appreciate your assistance!