Delta Column
- 4 minutes to read
A delta column calculates summaries against two measures, and displays the difference between these summaries. This difference can be communicated via a numeric value displayed within the delta element and an additional delta indication.
In code, delta columns are represented by the GridDeltaColumn class.
Data Binding Specifics
Delta columns are bound to two measures that provide two values: the Actual value and the Target value. The difference between these values is displayed within the column.
When you switch the column type to Delta, the data item container is changed, to accept the Actual and Target measures.
To bind the delta column to data in code, use the GridDeltaColumn.ActualValue and GridDeltaColumn.TargetValue properties.
Display Mode
Values in the delta column can be displayed as text, or represented by bars.
To select between these modes, invoke the Column Options window (see Column Types Overview to learn how to do this) and select Value or Bar.
If bars are displayed, use the Always show zero level check box to specify whether the bar’s minimum value is zero (checked) or an automatically selected value that ensures that the difference between bars is clearly displayed (unchecked).
To control the display mode in code, use the following properties:
Gets or sets how to display cell values. | |
Gets or sets whether the zero level of bars displayed within grid cells should always be visible. |
Delta Values and Indication
If the display type is set to Value, the Column Options window displays options that allow you to configure delta values and indication.
You can specify which values should be displayed in the delta column. To do this, use the Value type combo box in the Column Options window.
Value Type | Result |
---|---|
Actual Value | |
Absolute Variation | |
Percentage Variation | |
Percentage of Target |
To specify the condition for displaying delta indication, use the Result indication combo box in the Column Options window.
Condition | Result |
---|---|
Greater is Good | The ‘good’ indication is displayed if the actual value exceeds the target value; if the target value exceeds the actual value, the ‘bad’ indication is displayed. |
Less is Good | The ‘bad’ indication is displayed if the actual value exceeds the target value; if the target value exceeds the actual value, the ‘good’ indication is displayed. |
No Indication | Indication is not displayed. |
Warning if Greater | A warning is displayed if the actual value exceeds the target value; otherwise, no indication is displayed. |
Warning if Less | A warning is displayed if the target value exceeds the actual value; otherwise, no indication is displayed. |
To specify the delta value type and define when to display delta indication in code, use the DeltaOptions.ValueType and DeltaOptionsBase.ResultIndicationMode properties exposed by the DeltaOptions object, which can be accessed via the GridDeltaColumn.DeltaOptions property.
The Format tab allows you to specify the numeric display format for different value types, as described in the Formatting Data document. In code, you can use the following properties:
- GridDeltaColumn.ActualValue.NumericFormat
- GridDeltaColumn.AbsoluteVariationNumericFormat
- GridDeltaColumn.PercentOfTargetNumericFormat
- GridDeltaColumn.PercentVariationNumericFormat
The tab contains the following settings.
Format type | Specifies format types for numeric values. Available types are listed in the DataItemNumericFormatType enumeration. |
Unit | Specifies the unit to convert the numeric values. Available types are listed in the DataItemNumericUnit enumeration. |
Precision | Specifies the number of fractional digits to display. |
Currency | Specifies the currency symbol and format provided by the RegionInfo class. |
Culture | Specifies the name of a culture that defines the currency symbol and format. |
Include group separator | Specifies whether separators should be inserted between digit groups. |
Comparison Tolerance
The comparison tolerance allows you to specify more advanced conditions for displaying delta indication. For instance, you can set a specific indication to be displayed when the actual value exceeds the target value by 10% or by $2K.
Use the Threshold type combo box to select whether you wish to specify the comparison tolerance in percentage values or in absolute values. Then use the Threshold value box to specify the comparison tolerance. If the delta value is between the positive and negative Threshold, the delta value is gray and no indication is displayed.
To do this in code, use the DeltaOptionsBase.ResultIndicationThresholdType and DeltaOptionsBase.ResultIndicationThreshold properties respectively. These properties are exposed by the DeltaOptions object, which can be accessed via the GridDeltaColumn.DeltaOptions property.
The following code snippet creates the Delta column:
var grid = new GridDashboardItem();
grid.DataSource = dataSource;
var gridDelta = new GridDeltaColumn();
gridDelta.ActualValue = new Measure("Count");
gridDelta.TargetValue = new Measure("TargetCount");
grid.Columns.Add(gridDelta);