PivotFieldGroup
in package
Describes how a single source (cache) field is grouped in a pivot table.
Two kinds of grouping are supported:
- Numeric range grouping: values are bucketed into fixed-width intervals between a start and end number (e.g. 0-100, 100-200, ...).
- Date grouping: date/time values are grouped by one or more calendar parts (years, quarters, months, ...).
The grouping is emitted into the pivot cache definition; when the workbook is opened, the spreadsheet application applies it while refreshing the pivot.
Tags
Table of Contents
Constants
- GROUP_BY_DAYS = 'days'
- GROUP_BY_HOURS = 'hours'
- GROUP_BY_MINUTES = 'minutes'
- GROUP_BY_MONTHS = 'months'
- GROUP_BY_QUARTERS = 'quarters'
- GROUP_BY_SECONDS = 'seconds'
- GROUP_BY_YEARS = 'years'
- TYPE_DATE = 'date'
- TYPE_NUMERIC = 'numeric'
Methods
- date() : self
- Create a date grouping by one or more calendar units.
- getEndDate() : string|null
- getEndNum() : float|null
- getGroupBy() : array<string|int, string>
- getInterval() : float
- getStartDate() : string|null
- getStartNum() : float|null
- getType() : string
- isDate() : bool
- isNumeric() : bool
- numeric() : self
- Create a numeric range grouping (buckets of $interval width).
Constants
GROUP_BY_DAYS
public
mixed
GROUP_BY_DAYS
= 'days'
GROUP_BY_HOURS
public
mixed
GROUP_BY_HOURS
= 'hours'
GROUP_BY_MINUTES
public
mixed
GROUP_BY_MINUTES
= 'minutes'
GROUP_BY_MONTHS
public
mixed
GROUP_BY_MONTHS
= 'months'
GROUP_BY_QUARTERS
public
mixed
GROUP_BY_QUARTERS
= 'quarters'
GROUP_BY_SECONDS
public
mixed
GROUP_BY_SECONDS
= 'seconds'
GROUP_BY_YEARS
public
mixed
GROUP_BY_YEARS
= 'years'
TYPE_DATE
public
mixed
TYPE_DATE
= 'date'
TYPE_NUMERIC
public
mixed
TYPE_NUMERIC
= 'numeric'
Methods
date()
Create a date grouping by one or more calendar units.
public
static date(string|array<string|int, string> $groupBy[, string|null $startDate = null ][, string|null $endDate = null ]) : self
Parameters
- $groupBy : string|array<string|int, string>
-
one or more GROUP_BY_* constants
- $startDate : string|null = null
- $endDate : string|null = null
Return values
selfgetEndDate()
public
getEndDate() : string|null
Return values
string|nullgetEndNum()
public
getEndNum() : float|null
Return values
float|nullgetGroupBy()
public
getGroupBy() : array<string|int, string>
Return values
array<string|int, string>getInterval()
public
getInterval() : float
Return values
floatgetStartDate()
public
getStartDate() : string|null
Return values
string|nullgetStartNum()
public
getStartNum() : float|null
Return values
float|nullgetType()
public
getType() : string
Return values
stringisDate()
public
isDate() : bool
Return values
boolisNumeric()
public
isNumeric() : bool
Return values
boolnumeric()
Create a numeric range grouping (buckets of $interval width).
public
static numeric(float $interval[, float|null $startNum = null ][, float|null $endNum = null ]) : self
Parameters
- $interval : float
- $startNum : float|null = null
- $endNum : float|null = null