Class: Google::Apis::SheetsV4::PivotGroup
- Inherits:
-
Object
- Object
- Google::Apis::SheetsV4::PivotGroup
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/sheets_v4/classes.rb,
generated/google/apis/sheets_v4/representations.rb,
generated/google/apis/sheets_v4/representations.rb
Overview
A single grouping (either row or column) in a pivot table.
Instance Attribute Summary collapse
-
#group_rule ⇒ Google::Apis::SheetsV4::PivotGroupRule
An optional setting on a PivotGroup that defines buckets for the values in the source data column rather than breaking out each individual value.
-
#label ⇒ String
The labels to use for the row/column groups which can be customized.
-
#repeat_headings ⇒ Boolean
(also: #repeat_headings?)
True if the headings in this pivot group should be repeated.
-
#show_totals ⇒ Boolean
(also: #show_totals?)
True if the pivot table should include the totals for this grouping.
-
#sort_order ⇒ String
The order the values in this group should be sorted.
-
#source_column_offset ⇒ Fixnum
The column offset of the source range that this grouping is based on.
-
#value_bucket ⇒ Google::Apis::SheetsV4::PivotGroupSortValueBucket
Information about which values in a pivot group should be used for sorting.
-
#value_metadata ⇒ Array<Google::Apis::SheetsV4::PivotGroupValueMetadata>
Metadata about values in the grouping.
Instance Method Summary collapse
-
#initialize(**args) ⇒ PivotGroup
constructor
A new instance of PivotGroup.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ PivotGroup
Returns a new instance of PivotGroup
6087 6088 6089 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6087 def initialize(**args) update!(**args) end |
Instance Attribute Details
#group_rule ⇒ Google::Apis::SheetsV4::PivotGroupRule
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
6016 6017 6018 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6016 def group_rule @group_rule end |
#label ⇒ String
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
6037 6038 6039 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6037 def label @label end |
#repeat_headings ⇒ Boolean Also known as: repeat_headings?
True if the headings in this pivot group should be repeated.
This is only valid for row groupings and will be ignored by columns.
By default, we minimize repitition 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
6055 6056 6057 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6055 def repeat_headings @repeat_headings end |
#show_totals ⇒ Boolean Also known as: show_totals?
True if the pivot table should include the totals for this grouping.
Corresponds to the JSON property showTotals
6061 6062 6063 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6061 def show_totals @show_totals end |
#sort_order ⇒ String
The order the values in this group should be sorted.
Corresponds to the JSON property sortOrder
6067 6068 6069 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6067 def sort_order @sort_order end |
#source_column_offset ⇒ Fixnum
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
6075 6076 6077 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6075 def source_column_offset @source_column_offset end |
#value_bucket ⇒ Google::Apis::SheetsV4::PivotGroupSortValueBucket
Information about which values in a pivot group should be used for sorting.
Corresponds to the JSON property valueBucket
6080 6081 6082 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6080 def value_bucket @value_bucket end |
#value_metadata ⇒ Array<Google::Apis::SheetsV4::PivotGroupValueMetadata>
Metadata about values in the grouping.
Corresponds to the JSON property valueMetadata
6085 6086 6087 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6085 def @value_metadata end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 |
# File 'generated/google/apis/sheets_v4/classes.rb', line 6092 def update!(**args) @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 |