Back to Devexpress

Calculated Fields on the Web

dashboard-117196-web-dashboard-create-dashboards-on-the-web-providing-data-calculated-fields.md

latest4.9 KB
Original Source

Calculated Fields on the Web

  • Nov 24, 2022
  • 2 minutes to read

The Web Dashboard control supports calculated fields. Calculated fields allow you to apply expressions to data fields obtained from the dashboard’s data source. As a result, you can use these fields in data visualizations as regular data source fields.

Note

Calculated fields are not supported for the OLAP data source.

You can add a new calculated field based on the existing data source fields after you have created a data source.

Create a Calculated Field

You can create calculated fields in the Data Sources page or Binding panel of the dashboard item menu.

The Data Sources Page

Go to the dashboard menu and open the Data Sources page. Select a data source (and a query/data member, if applicable) and click the Add Calculated Field button to create a calculated field.

The Binding Panel

Open the Binding panel, go to the Binding section and click the Add calculated field button (the icon).

This invokes the Edit Calculated Field dialog that allows you to construct an expression for the field

You can specify the following option for a calculated field:

NameChanges the default field nameField TypeSpecifies the calculated field type

The following elements are available for expressions:

FieldsLists available fields and dashboard parameters.ConstantsLists Boolean variables.Functions

Lists different types of functions including aggregate.

You can find a list of common functions supported by expressions in the following topic: Expression Operators, Functions and Constants.

OperatorsLists available operators.

You can add a comment to your expression to explain it and make the expression more readable. Comments are multi-line and begin with /* and end with */.

After you created the expression, click Save to add a newly created calculated field and display it in the Field List. The f glyph indicates that this field is a calculated field:

Edit a Calculated Field

You can configure calculated fields both in the Data Sources page and from the Binding panel.

The Data Sources PageClick the calculated field’s Edit button (the icon)The Binding PanelSelect the calculated field you want to edit and click the Edit button (the icon).

This invokes the Edit Calculated Field dialog. You can change the calculated field’s name, type or edit the current expression.

To delete the calculated field, use the calculated field’s Delete button (the / icons).

See Also

Aggregations

Expression Constants, Operators, and Functions