FRAMES | NO FRAMES
BenchmarkReport Method

A comparative report that benchmarks two or more trade areas based on selected volumetric data (typically demographic data).

Availability: Business Analyst Server, Business Analyst Online.

TaskResultOutput BenchmarkReport ( 
    BenchmarkReportParameters  Parameters,
    esriReportFormat           ReportFormat,
    TaskOutputType[]           OutputTypes, 
    esriFolderItem             OutputReportItem
); 

Parameter Description
Parameters Configuration options for analysis. Type BenchmarkReportParameters.
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.

Returns

Variable of type TaskResultOutput

Remarks

The BenchmarkReport method allows you to compare multiple trade areas against one another to decipher how different or similar one location is over the next. You can easily measure the demographic characteristics of one area versus all other areas. The report shows statistical differences in raw number, percent, and index values.

Usage Tips

Examples

The example below generates a benchmark report based on two trade areas.

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.
 
RenderingParameters imageOptions;
TaskOutputType[] outputOptions;
esriFolderItem outputLayer;
esriFolderItem outputReport;
 
SimpleRingsParameters simpleRingsParameters;
TaskResultOutput simpleRingsResult;
 
// Create a PointRecord array of 2 store locations.
PointRecord[] storePoints = new PointRecord[2];
 
storePoints[0] = new PointRecord();
storePoints[0].Name = "store_study_site1";
storePoints[0].Description = "VA Study Site";
storePoints[0].StoreID = "1";
storePoints[0].Latitude = 38.92903;
storePoints[0].Longitude = -77.246422;
 
storePoints[1] = new PointRecord();
storePoints[1].Name = "store_study_site2";
storePoints[1].Description = "CA Study Site";
storePoints[1].StoreID = "2";
storePoints[1].Latitude = 32.870293;
storePoints[1].Longitude = -117.232903;
 
// Create a store feature layer based on the array of point records.
PointLayer storeLayer = new PointLayer();
storeLayer.Points = storePoints;
 
// ========= STEP 1: Create 1-mile simple ring around the first store
 
simpleRingsParameters = new SimpleRingsParameters();
 
// Set specific analysis parameters
simpleRingsParameters.DistanceUnits = esriUnits.esriMiles;
simpleRingsParameters.Radii = new double[] { 1 };
simpleRingsParameters.SingleStoreID = "1";
simpleRingsParameters.Stores = storeLayer;
 
// StoreIDField is useless for stores specified with array of PointRecord
//simpleRingsParameters.StoreIDField = "STORE_ID";
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };
outputLayer = null;
outputReport = null;
 
simpleRingsResult =
    baServerHelper.SimpleRings(simpleRingsParameters, imageOptions, outputOptions, outputLayer, outputReport);
 
DataLayer tradeAreaLayer1 = new DataLayer();
tradeAreaLayer1.RecordSet = simpleRingsResult.RecordSet;
 
// ========= STEP 2: Create 1-mile simple ring around the second store
 
simpleRingsParameters = new SimpleRingsParameters();
 
// Set specific analysis parameters
simpleRingsParameters.DistanceUnits = esriUnits.esriMiles;
simpleRingsParameters.Radii = new double[] { 1 };
simpleRingsParameters.SingleStoreID = "2";
simpleRingsParameters.Stores = storeLayer;
 
// StoreIDField is useless for stores specified with array of PointRecord
//simpleRingsParameters.StoreIDField = "STORE_ID";
 
// Set other parameters
imageOptions = null;
outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };
outputLayer = null;
outputReport = null;
 
simpleRingsResult =
    baServerHelper.SimpleRings(simpleRingsParameters, imageOptions, outputOptions, outputLayer, outputReport);
 
DataLayer tradeAreaLayer2 = new DataLayer();
tradeAreaLayer2.RecordSet = simpleRingsResult.RecordSet;
 
// ========= STEP 3: Execute the analysis
BenchmarkReportParameters parameters = new BenchmarkReportParameters();
 
// Set specific analysis parameters
parameters.BenchmarkOptions = esriBABenchmarkOptions.useAverageValues;
parameters.FieldSortType = esriBABenchmarkSortOptions.sortByFieldDifference;
parameters.SortFieldName = "TOTPOP_CY";
parameters.Summarizations = new string[] { "TOTPOP_CY", "TOTHH_CY" };
parameters.TAinRows = false;
parameters.TALayersFields = new string[] { "STORE_ID" };
parameters.TradeAreas = new DataLayer[] { tradeAreaLayer1, tradeAreaLayer2 };
 
// 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 = "Benchmark Report for two rings";
parameters.StandardReportOptions = reportOptions;
 
// Set other parameters
outputReport = null;
 
TaskResultOutput result = baServerHelper.BenchmarkReport(parameters, outputReport);
 
// Get the report URL
string reportURL = result.Reports[0].ReportURL;

See Also