DevExpress Dashboard - Calculated Fields at the Summary Level (Coming soon in v15.1)

Thinking Out Loud
01 June 2015

The upcoming release of DevExpress Dashboard includes the ability to use aggregate functions when constructing calculated field expressions. As you know, aggregate functions perform calculations on a set of values and return a single value. This allows you to pre-aggregate data source field values in a calculated field expression. The resulting calculated field is similar to a measure in multi-dimensional data sources such as OLAP cubes.

You can use any of the following predefined aggregate functions within the Dashboard Designer...

  • Avg() - Returns the average of all values in the expression.
  • Count() - Returns the number of values.
  • CountDistinct() - Returns the number of distinct values.
  • Max() - Returns the maximum value across all records.
  • Min() - Returns the minimum value across all records.
  • Sum() - Returns the sum of all values.

Let's quickly review how you can create a calculated field...Step 1 is to add a new field using the Field List's context menu.

DevExpress Dashboard - Caluclated Fields

In step 2, you must construct the expression using the DevExpress Expression Editor -  In this example, we'll navigate to Aggregate Functions and construct the following expression: Sum([Profit]) / Sum([Revenue])

DevExpress Dashboard - Expression Editor

Once the expression is complete, you can rename the calculated field. In our example, we'll rename it to Margin. 

At this point, you can simply drag and drop the new field to the desired Dashboard item. In the following example, we use Dashboard Cards to visualize the data..

.DevExpress Dashboard - Calculated Fields and Expressions

So what do you think - how likely are you to use this new feature? We'd love to hear your thoughts.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.