FRAMES | NO FRAMES |
Creates a new Tapestry segmentation profile from a table of aggregated segmentation information.
Availability: Business Analyst Server.
string ProfileByImportFromTable ( ProfileByImportFromTableParameters Parameters, esriFolderItem OutputItem );
Parameter | Description |
---|---|
Parameters | Configuration options for analysis. Type ProfileByImportFromTableParameters. |
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 ProfileByImportFromTable method when you want to import a segmentation profile that has already been summarized. For example, you may have a table that has a count of customers for each Tapestry segment. Use this method to import these counts and create a segmentation profile that can be used with other segmentation methods.
The table below illustrates how an import table may look. In the ProfileByImportFromTableParameters, the IDField parameter will be set to the "TAPCODE" and the CountField parameter will be set to the "COUNT".
The example below generates a profile from a table consisting of market Tapestry segment codes. See GetSegments lookup operation to query available Tapestry segments.
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 // Create table fields Field[] fields = new Field[4]; fields[0] = new Field(); // Object ID (OID) index field fields[0].AliasName = "OID"; fields[0].Name = "OID"; fields[0].Length = 15; fields[0].Type = esriFieldType.esriFieldTypeOID; fields[1] = new Field(); // Customer description fields[1].AliasName = "CUST_TYPE"; fields[1].Name = "CUST_TYPE"; fields[1].Length = 15; fields[1].Type = esriFieldType.esriFieldTypeString; fields[2] = new Field(); // Market tapestry segment ID code fields[2].AliasName = "SEG_CODE"; fields[2].Name = "SEG_CODE"; fields[2].Length = 15; fields[2].Type = esriFieldType.esriFieldTypeString; fields[3] = new Field(); // Customer count fields[3].AliasName = "COUNT"; fields[3].Name = "COUNT"; fields[3].Length = 15; fields[3].Type = esriFieldType.esriFieldTypeInteger; Fields tableFields = new Fields(); tableFields.FieldArray = fields; // Create table records Record[] records = new Record[2]; records[0] = new Record(); records[0].Values = new object[] { "1", "Target", "5", 1232 }; records[1] = new Record(); records[1].Values = new object[] { "2", "Secondary", "30", 341 }; // Create table data RecordSet recordSet = new RecordSet(); recordSet.Fields = tableFields; recordSet.Records = records; TableData tableData = new TableData(); tableData.RecordSet = recordSet; ProfileByImportFromTableParameters parameters = new ProfileByImportFromTableParameters(); // Set specific analysis parameters parameters.CountField = "COUNT"; parameters.DataTable = tableData; parameters.IDField = "SEG_CODE"; parameters.VolumeField = null; // Set other parameters // In general, a non-null esriFolderItem is specified to save a newly-created // item to the server-side repository or to reference an existing item in it. esriFolderItem outputItem = new esriFolderItem(); outputItem.folderType = esriFolderType.esriFolderSegProfiles; outputItem.itemName = "segProfile_ProfileByImportFromTable"; outputItem.projectName = "Default Project"; outputItem.workspaceName = "Default Workspace"; string result = baServerHelper.ProfileByImportFromTable(parameters, outputItem); ProfileData segProfile = new ProfileData(); segProfile.Description = result; |