Alteryx Designer Desktop Discussions

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

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

byagelski
8 - Asteroid

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.

3 REPLIES 3
JoeL
Alteryx
Alteryx

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

 

Best,

 

Joe

byagelski
8 - Asteroid

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?

byagelski
8 - Asteroid

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!

Labels