Interface IXLPivotValueCombination
An interface for fluent configuration of how to show IXLPivotValue, when the value should be displayed not as a value itself, but in relation to another value (e.g. percentage difference in relation to different value).
public interface IXLPivotValueCombination
- Extension Methods
Methods
And(XLCellValue)
IXLPivotValue And(XLCellValue item)
Parameters
itemXLCellValue
Returns
AndNext()
IXLPivotValue AndNext()
Returns
AndPrevious()
The base item value for calculation will be the value of the previous row of base field, depending on the order of base field values in a row/column. If there isn't a previous value, the same value will be used.
This only affects display how are values displayed, not the values themselves.
Example:
We have a table of sales and a pivot table, where sales are summed per month.
The months are sorted from Jan to Dec. To display a percentage increase of
sales per month (the base value is previous month):
IXLPivotValue sales;
sales.SetSummaryFormula(XLPivotSummary.Sum).ShowAsPercentageDifferenceFrom("Month").AndPrevious();
IXLPivotValue AndPrevious()