Alteryx Design Pattern: Finding Unique Customers Based on Location (Method 1)
Where are my customers and are they unique to my brand or is there overlap with a competitor? To answer this question we need geospatial data about our stores, our competitors and where the customers are.
In this approach it uses a spatial match to understand whether my customers (point data) are within a unique trade area or multiple trade areas. An extension of this is would be if I want to find customers which meet a certain profile, for example sit within the trade area for multiple brands, for example if I want to find customers who are within a trade area for Store Brand A, B & C but not D.
Using the sample spatial datasets available within Alteryx I will build out this workflow.
First we create the spatial point data (customers / target) and the trade area around each store (universe). Using the Spatial Match tool we then find the matched locations where the target (customers) is within the universe (store trade areas).
![](https://www.altertricks.com/wp-content/uploads/2020/10/Screenshot-2020-10-24-at-15.59.02.png)
Then when we’ve got the matched data we can see when a customer has multiple matches they are represented by multiple records (one record for each store). Now we build on a design pattern used to find unique string values. Using a summarise tool to group by customerID and Store Name, then a second summarise to group by CustomerID and concatenate Store Name we get a list of all the stores that the customer is within the trade area. We can then use a filter tool to find the unique combination we are after, e.g. in this example the customers are in a Quick Fix Bikes trade area but are not in a Mellow Johnnies trade area.