How to do Calculations in Mail & Deploy?

How to do Calculations in Mail & Deploy?

FIRST CREATED ON 1 May 2020  I  AUTHOR Emma Camacho

The previously mentioned constant values (see Constant Values) and dynamic values (see Dynamic Values) can not only be used on their own, but they can be used in calculations by using the following operators:
&This operator can be used to concatenate two text values.
+
This operator can be used to add up two numeric values.

This operator can be used to subtract the numeric value right of the operator from the numeric value left of the operator.
/
This operator can be used to divide the numeric value left of the operator by the numeric value right of the operator.
*
This operator can be used to multiply two numeric values.


The syntax to concatenate the texts Hello and World is as follows:

"Hello" & " World"

You cannot only use constant values in these expressions; you could, for example, use the following expression to add value of the datasource field NetAmount and the value of the datasource field VatAmount; we assume here that these fields are both in the datasource Invoicing.

[Datasource].[Invoicing].[Field].[NetAmount] + [Datasource].[Invoicing].[Field].[NetAmount]

You can also mix constant values and dynamic values in these calculations; if you want to divide the datasource field YearlyRevenue of datasource Invoicing by 12 (e.g. in order to get an average monthly revenue value), you can use the following syntax:

[Datasource].[Invoicing].[Field].[YearlyRevenue] / 12

The dynamic values used do not necessarily have to belong to the same datasource; you could also write expressions which calculates values from different datasources, combined with constants.



Info

Looking for Additional Guidance?

If you require more detailed information or further assistance, please visit our comprehensive Online Documentation. Our resources are designed to help you navigate all features and functionalities effectively.


    • Related Articles

    • What are expressions in Mail & Deploy?

      FIRST CREATED ON 17 May 2023 I AUTHOR Emma Camacho In Mail & Deploy, expressions can be used to supply values to certain functions; expressions can either return constant values (see Constant Values), dynamic values (see Dynamic Values) or values ...
    • What are Constant Values in Mail & Deploy and how to use them?

      FIRST CREATED ON 17 May 2023 I AUTHOR Emma Camacho If you want to use a constant, non-calculated value in an expression, you can do this by using the following syntax, which depends on the data type of the constant you want to use. Text. If you want ...
    • What are Dynamic Values and how to use them in Mail & Deploy?

      FIRST CREATED 17 May 2023 I AUTHOR Emma Camacho Expressions are dynamic values - values which are dynamically obtained by the expression at the time of its evaluation. Example: You want to add a text report element to a report and you want the text ...
    • How to make use of Modules in Mail & Deploy?

      FIRST CREATED ON 17 May 2023 I AUTHOR Emma Camacho You can also write your own Visual Basic .NET code in a module. A module is a set of Visual Basic .NET code that contains functions to be used from any expression within the repository. This allows ...
    • CreateList(...)

      FIRST CREATED ON 17 Feb 2025 I AUTHOR Emma Camacho When writing an Expression in Mail & Deploy where you need a list, use the CreateList function. For example, when including columns 1,2 and 3 in a Table Element or including several templates in a ...