Skip to main content
Tag

PivotGridField.OlapExpression Property

Gets or sets an expression used to evaluate values for the current unbound field in OLAP. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v24.2.dll

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public string OlapExpression { get; set; }

Property Value

Type Description
String

A string that represents an expression used to evaluate values for the current field in OLAP.

Remarks

The code below shows how to set an unbound expression for OLAP:

using DevExpress.Xpf.PivotGrid;

public MainWindow() {
    // ... 
    var fieldPriceWithDiscount= new PivotGridField() { Caption = "Price with Discount", Area = FieldArea.DataArea }; 

    fieldPriceWithDiscount.OlapExpression = "[Measures].[Internet Standard Product Cost] * 0.9";

    pivotGridControl1.Fields.Add(fieldPriceWithDiscount);
}

The same unbound expression in XAML:

    <dxpg:x:Name="fieldPriceWithDiscount" Caption="Price with Discount"  Area="DataArea" AreaIndex="1"
                         OlapExpression="[Measures].[Internet Standard Product Cost] * 0.9" />

Use the PivotGridField.UnboundExpression property to get or set an unbound expression for regular data sources.

To learn more about unbound fields, see Unbound Fields.

See Also