Pivot Table
Feature Description
Generate pivot tables from dataset attribute tables to reduce record redundancy and simplify one-to-many relationships in records.
Special Notes:
- This tool only applies to: UDB/UDBX and database-type datasources.
- The combination of input fields, pivot table field, and value field must be unique. Otherwise, the pivot table field values will default to the maximum value of the "Value Field".
- The number of fields in the pivot table is determined by the "Input Fields" and each unique field value in the "Pivot Table Field". The row count is determined by unique combinations of "Input Fields". If multiple pivot table field values correspond to one input field combination, the maximum value will be used.
As shown below, the result attribute table is a pivot table of the source dataset's attribute table, better demonstrating the distribution of three land use types across two regions. "Input Fields" are DLBM and DLMC, whose unique combinations {031, Woodland}, {013, Dryland}, {021, Orchard} result in three records. The "Pivot Table Field" QY uses its two unique values "Longquanyi District" and "Wenjiang District" as field names. These fields will be populated with DLMJ values.
Parameter description
Parameter | Description | Type |
---|---|---|
Datasource | Specifies the target datasource for the pivot table dataset. | Datasource |
Dataset | Specifies the source vector dataset for pivot table creation. | DatasetVector |
Input Fields | Specifies source dataset fields to be included in the pivot table. Typically represents business fields (non-system) to retain in results. | String[] |
Pivot Table Field | Specifies a source field whose unique values will become output pivot table column names. Notes: 1. Output field names follow these rules:
3. Supported field types: numeric, string, date, time. Unsupported types: binary, boolean, geometry in spatial databases. |
String |
Value Field | Specifies a source field whose values will populate pivot table columns. | String |
Target Datasource | Specifies the datasource to store the result dataset. | Datasource |
Result Dataset Name | Specifies the name for the output attribute table dataset. | String |
Overwrite Existing Dataset (Optional) | Overwrite existing dataset with same name if checked. Unchecked: tool fails when duplicates exist. Default: unchecked. | boolean |
Output
Parameter | Description | Type |
---|---|---|
Target Dataset | Result vector dataset | DatasetVector |