FRAMES | NO FRAMES |
Profiles some demographic attributes of customer data calculating statistical parameters which are floor and ceiling bounds, an average, and a standard deviation.
Availability: Business Analyst Server.
string CustomerProfiling ( CustomerProfilingParameters Parameters );
Parameter | Description |
---|---|
Parameters | Customer profiling options. Type CustomerProfilingParameters. |
Variable of type String containing the Customer Profile in XML format.
The Customer Profiling is used to set up a definition query to search for geographic areas that meet a set of criteria. In other words, you can profile the composition of your customer data to determine what demographic variables best represent your customer base. In most cases, this criteria is based on an existing customer layer.
The CustomerProfiling method lets you set up an output string that will be used as an input for the CustomerProspecting method.
The geography level determines the feature layer that will be used to profile your customers. Each customer feature point is spatially matched to a single geographic feature in the geography layer and that feature's attributes are queried to meet the requirements set. These results are compiled for each customer and returned in the output string.
The example below creates records for 7 customers, geocodes these records, and creates a customer profile for 3 summarization variables.
C# |
// Instantiate the BAServerHelper class to access analysis methods BAServerHelper baServerHelper = new BAServerHelper(); baServerHelper.ActiveDatasetID = "USA_ESRI"; // Optional parameter baServerHelper.IsFullErrorMessage = true; // Default is false RenderingParameters imageOptions; TaskOutputType[] outputOptions; esriFolderItem outputLayer; // ========= STEP 1: Create a record set by customer addresses RecordSetByAddress[] customerAddresses = new RecordSetByAddress[7]; customerAddresses[0] = new RecordSetByAddress(); customerAddresses[0].Name = "customer1"; customerAddresses[0].Description = "Ocean Beach Customer"; customerAddresses[0].StoreID = "1"; customerAddresses[0].Address = "5080 Newport Ave."; customerAddresses[0].City = "San Diego"; customerAddresses[0].State = "CA"; customerAddresses[0].ZIP = "92107"; customerAddresses[0].CustomerID = "1"; customerAddresses[1] = new RecordSetByAddress(); customerAddresses[1].Name = "customer2"; customerAddresses[1].Description = "La Jolla Customer"; customerAddresses[1].StoreID = "1"; customerAddresses[1].Address = "1250 Prospect St."; customerAddresses[1].City = "La Jolla"; customerAddresses[1].State = "CA"; customerAddresses[1].ZIP = "92037"; customerAddresses[1].CustomerID = "2"; customerAddresses[2] = new RecordSetByAddress(); customerAddresses[2].Name = "customer3"; customerAddresses[2].Description = "Pacific Beach Customer"; customerAddresses[2].StoreID = "1"; customerAddresses[2].Address = "1762 Garnet Ave."; customerAddresses[2].City = "San Diego"; customerAddresses[2].State = "CA"; customerAddresses[2].ZIP = "92109"; customerAddresses[2].CustomerID = "3"; customerAddresses[3] = new RecordSetByAddress(); customerAddresses[3].Name = "customer4"; customerAddresses[3].Description = "Morena Customer"; customerAddresses[3].StoreID = "1"; customerAddresses[3].Address = "1240 W. Morena Blvd."; customerAddresses[3].City = "San Diego"; customerAddresses[3].State = "CA"; customerAddresses[3].ZIP = "92111"; customerAddresses[3].CustomerID = "4"; customerAddresses[4] = new RecordSetByAddress(); customerAddresses[4].Name = "customer5"; customerAddresses[4].Description = "Clairemont Customer"; customerAddresses[4].StoreID = "1"; customerAddresses[4].Address = "6393 Balboa Ave."; customerAddresses[4].City = "San Diego"; customerAddresses[4].State = "CA"; customerAddresses[4].ZIP = "92111"; customerAddresses[4].CustomerID = "5"; customerAddresses[5] = new RecordSetByAddress(); customerAddresses[5].Name = "customer6"; customerAddresses[5].Description = "Bird Rock Customer"; customerAddresses[5].StoreID = "1"; customerAddresses[5].Address = "5735 La Jolla Blvd."; customerAddresses[5].City = "La Jolla"; customerAddresses[5].State = "CA"; customerAddresses[5].ZIP = "92037"; customerAddresses[5].CustomerID = "6"; customerAddresses[6] = new RecordSetByAddress(); customerAddresses[6].Name = "customer7"; customerAddresses[6].Description = "University City Customer"; customerAddresses[6].StoreID = "1"; customerAddresses[6].Address = "3254 Governor Dr."; customerAddresses[6].City = "San Diego"; customerAddresses[6].State = "CA"; customerAddresses[6].ZIP = "92122"; customerAddresses[6].CustomerID = "7"; TaskResultOutput recordSetResult = baServerHelper.CreateRecordSetByAddresses(customerAddresses, esriFolderType.esriFolderCustomerLayers); TableData tableData = new TableData(); tableData.RecordSet = recordSetResult.RecordSet; GeocodeData geocodeData = new GeocodeData(); geocodeData.Table = tableData; // ========= STEP 2: Geocode the record set with customers CustomerStoreSetupByGeocodeTableParameters geocodeParameters = new CustomerStoreSetupByGeocodeTableParameters(); // Set specific analysis parameters geocodeParameters.GeocodeCustomers = true; geocodeParameters.GeocodeData = geocodeData; geocodeParameters.LinkField = "STORE_ID"; geocodeParameters.NameField = "NAME"; // Set other parameters imageOptions = null; outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass }; outputLayer = null; TaskResultOutput geocodeResult = baServerHelper.CustomerStoreSetupByGeocodeTable(geocodeParameters, imageOptions, outputOptions, outputLayer); PointLayer customerLayer = new PointLayer(); customerLayer.RecordSet = geocodeResult.RecordSet; // ========= STEP 3: Execute the analysis CustomerProfilingParameters parameters = new CustomerProfilingParameters(); // Set specific analysis parameters parameters.AnalysisExtent = null; parameters.Customers = customerLayer; parameters.DataLayerID = "US.BlockGroups"; parameters.ProfileType = esriCustomerProfilingFillingType.esriCustomerProfilingFloorAndCeilingValues; parameters.Summarizations = new string[] { "AVGHHSZ_CY", "MEDAGE_CY", "MEDHINC_CY" }; parameters.Variance = 20; string customerProfile = baServerHelper.CustomerProfiling(parameters); // An XML string with the customer profile is returned |