---
schema_version: "1"
id: 3f0fa6249d0327fc93f0a20632e81bf0cafe096fad93f99739dbc826b841b0c9
title: GroupingColumn Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_reports_groupingcolumn.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_reports_groupingcolumn.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 87873773f47e76384db58e22c0469050dc73c3fed7d5af15750bfed5f59169c3
description: Contains methods for describing fields that are used for column grouping.Returns the unique API name of the field or bucket field that is used for column grouping.Returns the localized display name of the field that is used for column grouping.Returns the data type of the field that is used for column grouping.Returns the level of grouping for the column.
---
# GroupingColumn Class

Contains methods for describing fields that are used for column grouping.

## Namespace

[Reports](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Reports.htm "The Reports namespace provides classes for accessing the same data as is available in the Salesforce Reports and Dashboards REST API.")

The GroupingColumn class provides basic information about column grouping fields. The GroupingInfo class includes additional methods for describing and updating grouping fields.

## GroupingColumn Methods

The following are methods for GroupingColumn. All are instance methods.

- **[getName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_reports_groupingcolumn.htm#apex_Reports_GroupingColumn_getName)**  
    Returns the unique API name of the field or bucket field that is used for column grouping.
- **[getLabel()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_reports_groupingcolumn.htm#apex_Reports_GroupingColumn_getLabel)**  
    Returns the localized display name of the field that is used for column grouping.
- **[getDataType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_reports_groupingcolumn.htm#apex_Reports_GroupingColumn_getDataType)**  
    Returns the data type of the field that is used for column grouping.
- **[getGroupingLevel()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_reports_groupingcolumn.htm#apex_Reports_GroupingColumn_getGroupingLevel)**  
    Returns the level of grouping for the column.

### getName()

Returns the unique API name of the field or bucket field that is used for column grouping.

#### Syntax

public String getName()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getLabel()

Returns the localized display name of the field that is used for column grouping.

#### Syntax

public String getLabel()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### getDataType()

Returns the data type of the field that is used for column grouping.

#### Syntax

public Reports.ColumnDataType getDataType()

#### Return Value

Type: [Reports.ColumnDataType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_reports_columndatatype.htm "The Reports.ColumnDataType enum describes the type of data in a column. It is returned by the getDataType method.")

### getGroupingLevel()

Returns the level of grouping for the column.

#### Syntax

public Integer getGroupingLevel()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

#### Usage

- In a summary report, 0, 1, or 2 indicates grouping at the first, second, or third row level.
- In a matrix report, 0 or 1 indicates grouping at the first or second row or column level.