Formula Editor
Formula Editor Overview
The Formula Editor feature is the powerhouse of your EVAL creation and serves as a methodical and logical scaffolding to guide you as you build an application. This feature exists in two main areas within the Builder:
- Setting visibility rules in sections, questions, answers, and results
- Setting up formula computations for a result
Formula Editor serves different objectives in these areas. Within a result, it will appear when choosing "formula" as your result format. Using spreadsheet-based language, you can program your application to run computations and display numerical results. You will also have the option to use a Formula Editor with the purpose of setting visibility rules for sections, questions, answers, and results. Visibility rules using spreadsheet-based language will be based on true or false statements. In other words, a statement must be true to enable or display a result
In each of these cases, the Formula Editor is designed to simplify and organize logic by breaking down formulas into names expressions, and using keywords to identify data sets. Data can easily become unwieldly, keeping complex logic organized into bite size consumables promotes traceability and transparency.
To foster trust across the community of users, all users with Player access will have read-only access to the Builder to inspect the developer's work. Edit rights within an application can only be granted by the account administrator or the application author.
Navigating to Formula Editor
From Visibility Rules
In the Detail Pane of any section, question, answer or result, click New Rule in the Visibility When section:

Then click Formula (below) to be navigated to the Formula Editor:

From Results

In the Detail Pane of the result:
- Select Formula as the Format. A Formula section will appear.
- Click the Formula box to be navigated to the Formula Editor
Components of a Formula
A formula is comprised of up to three components:

- Formula/Expression - The primary spreadsheet-based algorithm (also termed "primary expression"). It can optionally reference keywords and named expressions.
- Keyword - A name assigned to a data set (one or more sections, questions, choices/numerical answers, results) that can be used within a "named expression" or the primary "expressions".
- Named Expression - A spreadsheet-based sub-expression that can be used within another named expression (the "Expression" box above) to keep complex logic organized into bite size consumables. Keywords can be used in "named expressions" and "expressions".
Formula Editor User Interface
Formula
Provide an expression. This will be in the form of spreadsheet expressions to perform mathematical calculations and logical statements, such as is used in Excel or Google Sheets. As noted above, most spreadsheet functions are supported.
Formulas in visibility rules must always evaluate to true/false.
Formulas in results can evaluate to any type of result.
Formula expressions must have valid characters, formatting, and variables.
When any of those are removed from an application, any formulas may need to be adjusted.
An example is shown here of a simple expression for the calculation of body mass index:

This uses two keywords: Weight and Height, which is covered in the next section below.
Keywords
Add keywords to be used within your expression. These keywords will reference data in one or more sections, questions, choices or results.
Click New Keyword to expand the Keywords section.

Name
Provide a name for your keyword. This is the name you will reference in your expression.
Keyword titles must only contain letters and underscores.
For example: MyKeyword, my_keyword.
Source
Provide a source to which the keyword applies.
When searching the "source" library for questions, choices, or results, it is important that every question is unique and stands apart to ensure your data is traceable and accurate. In some cases, this may apply for answers depending on how data is consumed within logic statements and visibility rules.
Continuing with the example provided in the Add an expression section above, both "Weight" and "Height" are keywords. The following shows the "Weight" keyword populated:

The following shows the "Height" keyword populated:

The trash can icons above allow you to delete a keyword or a source within a keyword.
A rule must have conditions that reference valid sections, questions, choices, or results.
When any of those are removed from an application, a formula may need to be adjusted.
Named Expressions
Add expressions to break up large formulas into smaller components with easy-to-read names. Simple primary expressions will generally not have a named expression.
Click New Expression to expand the Named Expressions section.

Name
Provide a name for your expression. This is the name that will be referenced in the primary expression or in another named expression. You may only use letters and underscores.
Expression
Provide an expression. This will be in the form of spreadsheet expressions to perform mathematical calculations and logical statements, such as is used in Excel or Google Sheets. As noted above, most spreadsheet functions are supported.
Comment
Optionally provide additional helpful information on what this named expression entails.
The trash can icon above allow you to delete a named expression.
Use Case: CKD-EPI Equations for GFR
The CKD-EPI Equations for Glomerular Filtration Rate (GFR) application includes a series of questions used to calculate Estimated GFR and CKD Stage. The user has several equations to choose from. The following image shows the 2012 CKD-EPI Cystatin C formula as one result in the Details Pane:

Clicking on the formula opens formula editor to review the key elements of the Formula Editor that were used in this calculation.

As shown above, the first formula listed _(IF(AND(Sex="Female", CystC <= 0.8), FEM_CyLEight)_contains:
- Keyword of Sex
- Keyword of CystC
- Named expression of FEM_CyLEight. This named expression also references the keyword CystC.
Expanding the Sex keyword, you can see that this keyword was configured to be the result of the Sex field on the application:

Expanding the FEMCylEight named expressions, you can see the formula created for this:

Updated 3 months ago