Start a conversation

General calculation templates

  • Calculating with checkbox fields

    * Note: when testing your calculation with checkboxes in the Calculation Helper, use commas (,) as separator instead of semicolon (;). On the contrary, Castor EDC uses semicolon (;). Check if a box wa...

  • Calculate with grid fields

    You can also calculate with grid field values. For example, you can calculate the sum of a row or column in your grid. This of course makes sense if you are using numerical fields, but can sometimes a...

  • Validation or dependency on an empty field

    See here how you can allow empty fields in a calculation. If you want to create a validation warning or a dependency when there is no data entered in a field, you can use a calculation field to check ...

  • Calculate the score from several variables

    You can add values from different fields together using a calculation field. For example, you can use this template to calculate a risk score based on multiple risk factors. In this example we use the...

  • Check if a number contains X number of digits or decimal places

    Using calculation fields, it is possible to check if the number that is entered in a numerical field corresponds to a certain format. For example, you can check if a number contains 3 digits or if it ...

  • Using the record ID, institute or other predefined variables in a calculation

    Sometimes you may need to reference study information across the study (forms, reports or surveys). Using the following tags you can retrieve the information described below when and where it's necess...

  • Converting weight and length units

    Sometimes you need to convert the units of a given measure to keep a unified format across your study. These conversions are usually inches or feet to centimetres and pounds to kilograms, or vice-vers...

  • Check if a report was added

    Check with calculation To check if a report (e.g. an SAE form) was added, you can check if a required variable name on the report has been defined. You need the following syntax to achieve this: '##al...

  • Check if a text field contains any numbers

    When using a text field, you can use the following template to check whether the field contains any numbers and display a message of your choice.  Create a calculation field in the study form using th...

  • Calculate the average of several non-required variables

    The average is a mathematical value that represent the value in the center of a set of values. Unlike the median, the average or arithmetic mean does not take into account the position that each value...