FRAMES | NO FRAMES |
Creates a new Tapestry segmentation profile from a table of address records.
Availability: Business Analyst Server.
string ProfileByTableGeocoding ( ProfileByTableGeocodingParameters Parameters, esriFolderItem OutputItem );
Parameter | Description |
---|---|
Parameters | Configuration options for analysis. Type ProfileByTableGeocodingParameters. |
OutputItem | (Optional
parameter — can be null). Configuration options for storing the output profile in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem. |
Variable of type String containing XML serialized segmentation profile
Use the ProfileByTableGeocoding method when you want to create a segmentation profile based on address data.
For example, suppose you have records with addresses of your customers. Using this method, you can create the Tapestry segmentation profile for your customers. This profile will be used as the target segmentation profile for comparison with the base segmentation profile created by the ProfileByAreaSummation method in such analysis as Game Plan Chart, Market Analysis Report, and so on.
The table below illustrates how an address table may look. Using the address information from your table, Business Analyst can append a Tapestry segment to each matched address.
The example below creates a weighted market segmentation profile from a table of addresses and sales.
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 RecordSet table = new RecordSet(); // Create table fields string[] fieldNames = new string[] { "CUST_ID", "NAME", "ADDRESS", "CITY", "STATE", "ZIP", "STORE_ID", "SALES" }; table.Fields = new Fields(); table.Fields.FieldArray = new Field[fieldNames.Length]; for (int i = 0; i < fieldNames.Length; i++) { Field field = new Field(); field.Name = fieldNames[i]; field.Type = esriFieldType.esriFieldTypeString; table.Fields.FieldArray[i] = field; } // The last field is numeric table.Fields.FieldArray[fieldNames.Length - 1].Type = esriFieldType.esriFieldTypeInteger; // Create table records table.Records = new Record[5]; table.Records[0] = new Record(); table.Records[0].Values = new object[] { "101", "CUST1", "2355 Pine St.", "San Francisco", "CA", "94115", "1", 12343 }; table.Records[1] = new Record(); table.Records[1].Values = new object[] { "102", "CUST2", "2501 California St.", "San Francisco", "CA", "94115", "1", 10008 }; table.Records[2] = new Record(); table.Records[2].Values = new object[] { "103", "CUST3", "563 Ruger St.", "San Francisco", "CA", "94129", "2", 3200 }; table.Records[3] = new Record(); table.Records[3].Values = new object[] { "104", "CUST4", "301 Finley Rd.", "San Francisco", "CA", "94129", "2", 15802 }; table.Records[4] = new Record(); table.Records[4].Values = new object[] { "105", "CUST5", "614 Balboa St.", "San Francisco", "CA", "94129", "2", 4750 }; TableData tableData = new TableData(); tableData.RecordSet = table; // Specify geocode data GeocodeData geocodeData = new GeocodeData(); geocodeData.Table = tableData; ProfileByTableGeocodingParameters parameters = new ProfileByTableGeocodingParameters(); // Set specific analysis parameters parameters.GeocodeData = geocodeData; parameters.SegmentationBase = "Total Households"; parameters.WeightField = "SALES"; // Set other parameters esriFolderItem outputItem = null; string result = baServerHelper.ProfileByTableGeocoding(parameters, outputItem); ProfileData segProfile = new ProfileData(); segProfile.Description = result; |