The `PivotBatch` class represents one combination of data, variables and calculations that are needed when calculating the values of cells in a pivot table.

`R6Class`

object.

The combination of data name and variable names defines a batch. When the batch is calculated, the calculations specified in the batch are evaluated against the specified data, with the data being grouped by the variables specified in the batch. Individual result values can then be retrieved from the batch. See the "Performance" vignette for details.

`batchId`

The unique identifier for the batch.

`batchName`

The unique name of the batch.

`compatibleCount`

The number of pivot cell calculations that this batch supports.

`evaluated`

TRUE if this batch has been evaluated.

`results`

The results (a data frame) of the evaluation of the batch

`asString`

A text description of the batch.

`new()`

Create a new `PivotBatch` object.

```
PivotBatch$new(
parentPivot = NULL,
batchId = 0,
dataName = NULL,
variableNames = NULL,
values = NULL,
calculationName = NULL,
calculationGroupName = NULL
)
```

`parentPivot`

The pivot table that this `PivotBatch` instance belongs to.

`batchId`

The unique identifier for the batch.

`dataName`

The name of the data frame (as specified in `pt$addData()`) that this batch relates to.

`variableNames`

Specifies the combination of variable names (i.e. dimensionality) of the batch.

`values`

A list specifying the distinct list of values for each variable, i.e. `list(varName1=values1, varName2=values2, ...)`. `values` is not currently used and does not affect the batch compatibility logic.

`calculationName`

The first calculation added to this batch. Does not affect the batch compatibility logic.

`calculationGroupName`

The calculation group of the first calculation added to this batch. Does not affect the batch compatibility logic.

`isCompatible()`

Determine whether a combination of data and variables is compatible with this batch.

`addCompatible()`

Add a new set of values or a new calculation to the batch. with this batch.

```
PivotBatch$addCompatible(
values = NULL,
calculationName = NULL,
calculationGroupName = NULL
)
```

`values`

A list specifying the distinct list of values for each variable, i.e. `list(varName1=values1, varName2=values2, ...)`. `values` is not currently used and does not affect the batch compatibility logic.

`calculationName`

The calculation to add to the batch. Does not affect the batch compatibility logic.

`calculationGroupName`

The calculation group of the calculation to add to the batch. Does not affect the batch compatibility logic.

`getCalculationInternalName()`

Find the internal name of a calculation in the batch.

`getSummaryValueFromBatch()`

Retrieve one calculation value from the batch, typically for the value of one cell in a pivot table.

```
PivotBatch$getSummaryValueFromBatch(
filters = NULL,
calculationName = NULL,
calculationGroupName = NULL
)
```

`filters`

A `PivotFilters` instance that specifies which value to retrieve. This filters object is a combination of the row, column and calculation filters.

`calculationName`

The name of the calculation value to retrieve.

`calculationGroupName`

The calculation group of the calculation to retrieve.

```
# This class should only be created by the pivot table.
# It is not intended to be created outside of the pivot table.
```