Skip to main content
A newer version of this page is available. .

DifferenceCalculation Class

A difference calculation that is used to compute the difference between measure values across a window.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v20.2.Core.dll

NuGet Packages: DevExpress.Dashboard.Core, DevExpress.WindowsDesktop.Dashboard.Core

Declaration

public class DifferenceCalculation :
    BaseCalculation<DifferenceCalculation>

Remarks

To apply a calculation to values of the required measure, perform the following steps.

Example

The code snippet adds a new measure to the Pivot dashboard item and specifies a window calculation to compute the difference between measure values across a window. The calculation is performed along columns of the Pivot dashboard item.

using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
// ...
PivotDashboardItem pivotItem = dashboardViewer1.Dashboard.Items[pivotItemName] as PivotDashboardItem;
if (pivotItem != null)
{
    Measure extendedPrice = new Measure("Extended Price")
    {
        Name = "Diff",
        ShowGrandTotals = false
    };
    PivotWindowDefinition pivotWindowDefinition = new PivotWindowDefinition();
    pivotWindowDefinition.DefinitionMode = PivotWindowDefinitionMode.Columns;
    extendedPrice.WindowDefinition = pivotWindowDefinition;
    extendedPrice.Calculation = new DifferenceCalculation() { DifferenceType = DifferenceType.Absolute };
    pivotItem.Values.Add(extendedPrice);
}

Inheritance

Object
DevExpress.DashboardCommon.Native.ClonableModelBase<MeasureCalculation>
MeasureCalculation
DevExpress.DashboardCommon.Native.BaseCalculation<DifferenceCalculation>
DifferenceCalculation
See Also