FRAMES | NO FRAMES |
Compares the demographic profiles of two customer layers and reports on the differences.
Availability: Business Analyst Server 10.0.
TaskResultOutput CustomerDemographicComparison ( CustomerDemographicComparisonParameters Parameters, esriReportFormat ReportFormat, TaskOutputType[] OutputTypes, esriFolderItem OutputReportItem );
Parameter | Description |
---|---|
Parameters | Configuration options for analysis. Type CustomerDemographicComparisonParameters. |
ReportFormat | This parameter should be null. This parameter is deprecated. |
OutputTypes | Array of task output options. Options for this method include creating a report (GetReport). Type TaskOutputType[]. |
OutputReportItem | (Optional
parameter — can be null). Configuration options for storing the output report in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem. |
Variable of type TaskResultOutput
The Customer Demographic Comparison report allows you to contrast the demographic attributes of one set of customers against another. Think of the report as using a combination of Customer Profiling and the Benchmark Report. It takes a profile of the underlying geographies that intersect your customer points and compares it to another customer profile. The differences are shown by total number and percentage.
The example below generates a Customer Demographic Comparison report.
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 // You can specify below a domain of your local Business Analyst Server. //baServerHelper.BAServerDomain = "esri.com"; // If a domain name is specified, a local server name in output URLs is replaced with the // fully-addressable server name so people and machines outside the domain of your local // Business Analyst Server instance can access these URLs. // Create two PointRecord arrays containing 2 customer locations each PointRecord[] customerPoints1 = new PointRecord[2]; customerPoints1[0] = new PointRecord(); customerPoints1[0].Name = "jane_smith"; customerPoints1[0].Description = "Jane Smith"; customerPoints1[0].StoreID = "5"; customerPoints1[0].Latitude = 32.74198; customerPoints1[0].Longitude = -117.24996; customerPoints1[1] = new PointRecord(); customerPoints1[1].Name = "miguel_sanchez"; customerPoints1[1].Description = "Miguel Sanchez"; customerPoints1[1].StoreID = "5"; customerPoints1[1].Latitude = 32.781143; customerPoints1[1].Longitude = -117.235664; PointRecord[] customerPoints2 = new PointRecord[2]; customerPoints2[0] = new PointRecord(); customerPoints2[0].Name = "pam_lee"; customerPoints2[0].Description = "Pam Lee"; customerPoints2[0].StoreID = "5"; customerPoints2[0].Latitude = 32.811494; customerPoints2[0].Longitude = -117.231709; customerPoints2[1] = new PointRecord(); customerPoints2[1].Name = "byron_jackson"; customerPoints2[1].Description = "Byron Jackson"; customerPoints2[1].StoreID = "5"; customerPoints2[1].Latitude = 32.854672; customerPoints2[1].Longitude = -117.204533; // Specify the spatial reference for analysis SpatialReference spatialReference = new GeographicCoordinateSystem(); spatialReference.WKID = 4326; spatialReference.WKIDSpecified = true; // Create two customer feature layers based on arrays of point records PointLayer customerLayer1 = new PointLayer(); customerLayer1.Points = customerPoints1; customerLayer1.SpatialReference = spatialReference; PointLayer customerLayer2 = new PointLayer(); customerLayer2.Points = customerPoints2; customerLayer2.SpatialReference = spatialReference; // Create an extent to be used in the analysis EnvelopeN envelope = new EnvelopeN(); envelope.XMin = -117.559; envelope.XMax = -117.122; envelope.YMin = 32.7117; envelope.YMax = 32.9567; envelope.SpatialReference = spatialReference; ExtentData extent = new ExtentData(); extent.Extent = envelope; CustomerDemographicComparisonParameters parameters = new CustomerDemographicComparisonParameters(); // Set specific analysis parameters parameters.AnalysisExtent = extent; parameters.FirstCustomerLayer = customerLayer1; parameters.SecondCustomerLayer = customerLayer2; parameters.GeographyLayerID = "US.BlockGroups"; parameters.Summarizations = new string[] { "TOTPOP_CY", "TOTHH_CY", "FAMPOP_CY" }; // Set report options ReportOptions reportOptions = new ReportOptions(); reportOptions.ReportFormat = "PDF"; reportOptions.ReportHeader = new KeyValue[1]; reportOptions.ReportHeader[0] = new KeyValue(); reportOptions.ReportHeader[0].Key = "subtitle"; reportOptions.ReportHeader[0].Value = "Custom Report Title"; parameters.StandardReportOptions = reportOptions; // Set other parameters esriFolderItem outputReport = null; TaskResultOutput result = baServerHelper.CustomerDemographicComparison(parameters, outputReport); string reportURL = result.Reports[0].ReportURL; |