FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.5   R E S T    R E P O R T    T A S K

Market Ranking Endpoint

Generates a report to rank data based on a selected variable.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/MarketRanking/execute

Specific Parameters

Parameter

Description

NameField (required)

The attribute field in the RankingData layer which specifies a name of every feature. Type string.

PrimaryRankField (required)

The attribute field in the RankingData layer which specifies a field to rank features. Type string.

RankingData (required)

A point or polygon layer containing features to be ranked. Type PointLayer.

AdditionalFields (optional)

Array of additional fields of the RankingData layer to be shown in the output report and to be exported to the output feature class. The additional fields must have a numerical type because they are used in calculation the summary rank.

AnalysisExtent (optional)

Data extent to restrict the analysis. Type ExtentData.

FeaturesLimit (optional)

The maximum number of ranked features to be shown in the output report and to be exported to the output feature layer. Type int.

Default: 1000.

IncludeSummaryField (optional)

An option that shows summary rank values in the report. Type boolean.

Default: false.

PercentField (optional)

The attribute field in the RankingData layer which specifies a field to be used for calculation the percentage of the PrimaryRankField field with respect to this field. Type string.

RankPercentages (optional)

An option that shows percentage of the PrimaryRankField field with respect to PercentField field in the output report. Type boolean.

Default: false.

UseAllFeatures (optional)

An option specifying the use of all features of the RankingData layer in the analysis. Type boolean.

Default: false.

Other Parameters

Parameter

Description

OutputType (required)

Array of task output options. Options for this endpoint include rendering an output image (GetMapImage), creating a feature layer for subsequent analysis (GetFeatureClass), and creating a report (GetReport). Type array of TaskOutputType.

ActiveDatasetID (optional)

ID of the active dataset. Type string.

Default: ID of the first available dataset.

f (optional)

Response format. Type string. Available formats: HTML, JSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

OutputAnalysisItem (optional)

Configuration options for storing the output feature layer in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem.

OutputReportItem (optional)

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.

OutputSpatialReference (optional)

An option specifying the spatial reference to return the output feature layer in. Type SpatialReference. If this parameter is missing, the output record set will be returned in the default spatial reference. See Get Default Spatial Reference lookup operation to query the default spatial reference.

RenderingParameters (optional)

Configuration options for rendering output when GetMapImage option is specified in the OutputType parameter. Type RenderingParameters.

ReturnGeometry (optional)

An option specifying the presence of the shape attribute in the returned record set. Type boolean.

Default: true.

StandardReportOptions (optional)

Report parameters. Type ReportOptions. The TemplateName parameter is ignored.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Variable of type TaskResultOutput

Remarks

The analysis can be restricted to an analysis extent if the AnalysisExtent parameter is specified. The optional UseAllFeatures parameter expands the analysis on all features of the RankingData layer including those out of the analysis extent.

 

Features of the RankingData layer are ranked by the primary ranking field specified with the PrimaryRankField parameter. If the RankPercentages parameter is true, the PercentField parameter should specify a field to calculate the percentage of the primary ranking field. Features having top FeatureLimit values of the primary ranking field are shown in the report and are exported to the output feature layer.

Usage Tips

• Use this report to determine how well a market will rank based on one or more attributes.

• You can rank either point data or polygon data.

• The report will rank a given set of features based on a primary rank field.

• You can use the AdditionalFields option to create a ranking report with two or more attributes.

• Set the UseAllFeatures option to the true value if you want to rank all features in the input layer.

• If you want to rank your market and display only the top N number of features, set this value for the FeaturesLimit option.

Example Usage

The example below generates a Market Ranking report from a standard geography layer.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/MarketRanking/execute?rankingdata={"Recordset":{"geometryType":"esriGeometryPoint","spatialReference":{"wkid":4326},"features":[{"geometry":{"x":-122.4329,"y":37.73325,"spatialReference":{"wkid":4326}},"attributes":{"OID":1,"NAME":"Customer 2","DESCR":"My second customer","SALES":800,"SCORE":80}},{"geometry":{"x":-122.4346,"y":37.78415,"spatialReference":{"wkid":4326}},"attributes":{"OID":2,"NAME":"Customer 1","DESCR":"My first customer","SALES":900,"SCORE":90}}]}}&namefield=NAME&primaryrankfield=SALES&standardreportoptions={"ReportFormat":"PDF","ReportHeader":[{"key":"subtitle","value":"Report title"}]}&outputtype=[GetFeatureClass, GetReport]&f=pjson

 

Response

{
 "results": [
  {
   "paramName": "RecordSet",
   "dataType": "GPFeatureRecordSetLayer",
   "value": {
    "displayFieldName": "",
    "fieldAliases": {
     "OBJECTID": "Object ID",
     "NAME": "NAME",
     "SALES": "SALES"
    },
    "geometryType": "esriGeometryPoint",
    "spatialReference": {
     "wkid": 4326,
     "latestWkid": 4326
    },
    "fields": [
     {
      "name": "OBJECTID",
      "type": "esriFieldTypeOID",
      "alias": "Object ID"
     },
     {
      "name": "NAME",
      "type": "esriFieldTypeString",
      "alias": "NAME",
      "length": 256
     },
     {
      "name": "SALES",
      "type": "esriFieldTypeInteger",
      "alias": "SALES"
     }
    ],
    "features": [
     {
      "attributes": {
       "OBJECTID": 1,
       "NAME": "Customer 1",
       "SALES": 900
      },
      "geometry": {
       "x": -122.4346,
       "y": 37.784149999999997
      }
     },
     {
      "attributes": {
       "OBJECTID": 2,
       "NAME": "Customer 2",
       "SALES": 800
      },
      "geometry": {
       "x": -122.43289999999999,
       "y": 37.733249999999998
      }
     }
    ]
   }
  },
  {
   "paramName": "Market Ranking.PDF",
   "dataType": "GPDataFile",
   "value": {
    "url": "http://localhost:6080/arcgis/rest/directories/arcgisoutput/DefaultMap_MapServer/_ags_T4486AC8454C398A1721744D1E1D86.pdf"
   }
  }
 ],
 "messages": [
  
 ]
}

 

NOTE: The response has been abbreviated where "..." is noted.


JSON Response Example Rendered with the ArcGIS API for JavaScript

Example Usage Rendering

See Also

Business Analyst Server REST Reference