Class: Google::Apis::SheetsV4::PivotValue

Inherits:
Object
  • Object
show all
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

The definition of how a value in a pivot table should be calculated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ PivotValue

Returns a new instance of PivotValue



6751
6752
6753
# File 'generated/google/apis/sheets_v4/classes.rb', line 6751

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#calculated_display_typeString

If specified, indicates that pivot values should be displayed as the result of a calculation with another pivot value. For example, if calculated_display_type is specified as PERCENT_OF_GRAND_TOTAL, all the pivot values are displayed as the percentage of the grand total. In the Sheets UI, this is referred to as "Show As" in the value section of a pivot table. Corresponds to the JSON property calculatedDisplayType

Returns:

  • (String)


6720
6721
6722
# File 'generated/google/apis/sheets_v4/classes.rb', line 6720

def calculated_display_type
  @calculated_display_type
end

#formulaString

A custom formula to calculate the value. The formula must start with an = character. Corresponds to the JSON property formula

Returns:

  • (String)


6726
6727
6728
# File 'generated/google/apis/sheets_v4/classes.rb', line 6726

def formula
  @formula
end

#nameString

A name to use for the value. Corresponds to the JSON property name

Returns:

  • (String)


6731
6732
6733
# File 'generated/google/apis/sheets_v4/classes.rb', line 6731

def name
  @name
end

#source_column_offsetFixnum

The column offset of the source range that this value reads from. For example, if the source was C10:E15, a sourceColumnOffset of 0 means this value refers to column C, whereas the offset 1 would refer to column D. Corresponds to the JSON property sourceColumnOffset

Returns:

  • (Fixnum)


6739
6740
6741
# File 'generated/google/apis/sheets_v4/classes.rb', line 6739

def source_column_offset
  @source_column_offset
end

#summarize_functionString

A function to summarize the value. If formula is set, the only supported values are SUM and CUSTOM. If sourceColumnOffset is set, then CUSTOM is not supported. Corresponds to the JSON property summarizeFunction

Returns:

  • (String)


6749
6750
6751
# File 'generated/google/apis/sheets_v4/classes.rb', line 6749

def summarize_function
  @summarize_function
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6756
6757
6758
6759
6760
6761
6762
# File 'generated/google/apis/sheets_v4/classes.rb', line 6756

def update!(**args)
  @calculated_display_type = args[:calculated_display_type] if args.key?(:calculated_display_type)
  @formula = args[:formula] if args.key?(:formula)
  @name = args[:name] if args.key?(:name)
  @source_column_offset = args[:source_column_offset] if args.key?(:source_column_offset)
  @summarize_function = args[:summarize_function] if args.key?(:summarize_function)
end