class Google::Apis::SheetsV4::PivotGroup

A single grouping (either row or column) in a pivot table.

Attributes

data_source_column_reference[RW]

An unique identifier that references a data source column. Corresponds to the JSON property `dataSourceColumnReference` @return [Google::Apis::SheetsV4::DataSourceColumnReference]

group_limit[RW]

The count limit on rows or columns in the pivot group. Corresponds to the JSON property `groupLimit` @return [Google::Apis::SheetsV4::PivotGroupLimit]

group_rule[RW]

An optional setting on a PivotGroup that defines buckets for the values in the source data column rather than breaking out each individual value. Only one PivotGroup with a group rule may be added for each column in the source data, though on any given column you may add both a PivotGroup that has a rule and a PivotGroup that does not. Corresponds to the JSON property `groupRule` @return [Google::Apis::SheetsV4::PivotGroupRule]

label[RW]

The labels to use for the row/column groups which can be customized. For example, in the following pivot table, the row label is `Region` (which could be renamed to `State`) and the column label is `Product` (which could be renamed `Item`). Pivot tables created before December 2017 do not have header labels. If you'd like to add header labels to an existing pivot table, please delete the existing pivot table and then create a new pivot table with same parameters. --------------———------- | SUM of Units | Product | | | Region | Pen | Paper | --------------———------- | New York | 345 | 98 | | Oregon | 234 | 123 | | Tennessee | 531 | 415 | --------------——— ------- | Grand Total | 1110 | 636 | --------------———------- Corresponds to the JSON property `label` @return [String]

repeat_headings[RW]

True if the headings in this pivot group should be repeated. This is only valid for row groupings and is ignored by columns. By default, we minimize repetition of headings by not showing higher level headings where they are the same. For example, even though the third row below corresponds to “Q1 Mar”, “ Q1” is not shown because it is redundant with previous rows. Setting repeat_headings to true would cause “Q1” to be repeated for “Feb” and “Mar”. +- ————-+ | Q1 | Jan | | | Feb | | | Mar | --------—–+ | Q1 Total | + ————–+ Corresponds to the JSON property `repeatHeadings` @return [Boolean]

repeat_headings?[RW]

True if the headings in this pivot group should be repeated. This is only valid for row groupings and is ignored by columns. By default, we minimize repetition of headings by not showing higher level headings where they are the same. For example, even though the third row below corresponds to “Q1 Mar”, “ Q1” is not shown because it is redundant with previous rows. Setting repeat_headings to true would cause “Q1” to be repeated for “Feb” and “Mar”. +- ————-+ | Q1 | Jan | | | Feb | | | Mar | --------—–+ | Q1 Total | + ————–+ Corresponds to the JSON property `repeatHeadings` @return [Boolean]

show_totals[RW]

True if the pivot table should include the totals for this grouping. Corresponds to the JSON property `showTotals` @return [Boolean]

show_totals?[RW]

True if the pivot table should include the totals for this grouping. Corresponds to the JSON property `showTotals` @return [Boolean]

sort_order[RW]

The order the values in this group should be sorted. Corresponds to the JSON property `sortOrder` @return [String]

source_column_offset[RW]

The column offset of the source range that this grouping is based on. For example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means this group refers to column `C`, whereas the offset `1` would refer to column `D`. Corresponds to the JSON property `sourceColumnOffset` @return [Fixnum]

value_bucket[RW]

Information about which values in a pivot group should be used for sorting. Corresponds to the JSON property `valueBucket` @return [Google::Apis::SheetsV4::PivotGroupSortValueBucket]

value_metadata[RW]

Metadata about values in the grouping. Corresponds to the JSON property `valueMetadata` @return [Array<Google::Apis::SheetsV4::PivotGroupValueMetadata>]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/sheets_v4/classes.rb, line 7245
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/sheets_v4/classes.rb, line 7250
def update!(**args)
  @data_source_column_reference = args[:data_source_column_reference] if args.key?(:data_source_column_reference)
  @group_limit = args[:group_limit] if args.key?(:group_limit)
  @group_rule = args[:group_rule] if args.key?(:group_rule)
  @label = args[:label] if args.key?(:label)
  @repeat_headings = args[:repeat_headings] if args.key?(:repeat_headings)
  @show_totals = args[:show_totals] if args.key?(:show_totals)
  @sort_order = args[:sort_order] if args.key?(:sort_order)
  @source_column_offset = args[:source_column_offset] if args.key?(:source_column_offset)
  @value_bucket = args[:value_bucket] if args.key?(:value_bucket)
  @value_metadata = args[:value_metadata] if args.key?(:value_metadata)
end