How to: Create a Calculated Field

This tutorial illustrates how to create a calculated field that is used to calculate a product of two fields and display the result in your Snap report.

Follow these steps to create a calculated field in Snap.

  1. Open your Snap report.
  2. Right-click any item inside the dataset node in the Data Explorer window to create a calculated field, and then choose Add Calculated Field in the invoked menu.

    Snap_AddCalculatedFields

  3. Then, right-click the created calculated field and in the invoked popup menu select the Edit Calculated Fields... command.

    Snap-calculated-fields

    In the invoked Collection Editor, set CalculatedField.FieldType to Float and CalculatedField.Name to Amount (CalculatedField.DisplayName will be automatically set to the same value).

    Snap_CollectionEditor.png

  4. In the same dialog, click the ellipsis button for the Expression property.

    In the invoked Expression Editor, specify the required expression (in this tutorial, we calculate the product of two fields: [UnitPrice] and [UnitsOnOrder]).

    Snap_ExpressionEditor

    To close the dialog and save the expression, click OK.

  5. Now, you can add the calculated field to your report just like you would a simple data field.

    Snap_CalculatedFieldNewColumn