获得 Business Analyst 许可后可用。
摘要
This tool is designed to use multiple SALES fields, which are extracted from the OLAP cube to build criteria for assigning customers to the stores.
用法
语法
AssignCustomersBySOLAP_ba (CustomerLayer, InStoreDimension, InSelectedHierarchyLevels, WayToDefineLinkField, LinkField, {VBSScriptString}, {InAssignToOneStore}, {CreateNewFeatureClass}, {OutputFeatureClass})
参数 | 说明 | 数据类型 |
CustomerLayer | The customer layer used to make the customer assignments to each store. | Feature Layer |
InStoreDimension | Select the store dimension in the customer layer. A dimension is an axis of an OLAP cube. | String |
InSelectedHierarchyLevels | Select the hierarchy level to process. Hierarchies categorize a dimension into a number of levels. More than one hierarchy can be associated with the same dimension. | String |
WayToDefineLinkField | Determines how store is selected.
| String |
LinkField | The store ID field that will be used to assign customers. | String |
VBSScriptString (可选) | Input a custom VBS script assigning customers to stores based on the dimensions in the customer layer. | String |
InAssignToOneStore (可选) | Allows the user to decide if the assignment of a customer to a store will be influenced by which store he/she shops at most.
| Boolean |
CreateNewFeatureClass (可选) | Generates a new feature class based on the existing layer or uses the existing layer.
| Boolean |
OutputFeatureClass (可选) | The feature class that will contain the customer features. | Feature Class |
代码示例
AssignCustomersBySOLAP example (stand-alone script)
# Name: AssignCustomersBySOLAP.py
# Description: Assigns customers in the San Francisco area to their designated store.
# Author: Esri
# Import system modules
import arcview
import arcpy
arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.6\Business Analyst\ArcToolbox\Toolboxes\Business Analyst Tools.tbx")
try:
# Acquire extension license
arcpy.CheckOutExtension("Business")
# Define the parameters for the Assign Customers by SOLAP Data tool
CustPath = "C:\My Output Data\Projects\Default Project\CustLayers\OLAP\Customer.shp"
StoreDim = "Product"
Hierarchy = "ALL"
StoreId = "STORE_ID"
# Assign Customers by SOLAP Data
arcpy.AssignCustomersBySOLAP_ba(CustPath,
StoreDim,
Hierarchy,
StoreId)
# Release extension license
arcpy.CheckInExtension("Business")
except:
print arcpy.GetMessages(2)
环境
此工具不使用任何地理处理环境。
许可信息
- ArcGIS Desktop Basic: 需要 Business Analyst
- ArcGIS Desktop Standard: 需要 Business Analyst
- ArcGIS Desktop Advanced: 需要 Business Analyst