Skip to Content
SurveysCalculations

Survey Calculations

Calculations take the results of questions and lookups from your survey template and let you derive new values using arithmetic. Calculations can also reference other calculations. You can add, subtract, multiply, and divide to produce values used in recommendations.

To create a calculation, click the Calculations tab on the survey template and then Add Calculation.

On this screen: The Calculations tab shows Add Calculation above a table with selection checkboxes, Name, and Expression, in that order. Click a calculation’s name to edit it. Select calculations to reveal bulk Delete.

If you need to insert a fixed value into a recommendation, you can create a calculation that adds 0 + 1 to return that constant.

Start a fresh survey response to test a calculation added after an existing response was created. Recalculating the older response does not include that new calculation.

Basic Calculations

To create a calculation based on question responses, reference questions by their slug and combine them with the available operators. The right side of the calculation form lists all available operands and operators.

On this screen: The Add Calculation or Edit Calculation slide-out has Cancel and Save at the top. The left column contains Name of the result and Calculation to be performed, a text area with the placeholder floors * area_per_floor. Saved calculations also show a read-only Slug. The right column has Operators for arithmetic, grouping, comparisons, and conditional expressions, followed by Questions, Lookups, and Calculations when operands are available. Click an operator or operand to insert it into the expression.

For example, a calculation can multiply the response to one question by the response to another:

On this screen: The Calculation to be performed field contains an expression that multiplies the slugs of two questions together, such as question_one * question_two. The operands listed in the right panel show the slugs of both questions under the Questions subsection.

The resulting value can then be used as the quantity for a service recommendation.

On this screen: The Recommendation form starts with Item Type (Service, Governance, or Product) and a searchable Item picker for that type. Type to search matching items and scroll to load more results. Service choices include their category in the label when available. The Quantity dropdown has the placeholder Survey value or calculation and lists available survey values and calculations. Below, When does the recommendation apply? offers Always or Only when with conditional fields for selecting a survey value, a comparison operator, and a comparison value.

Conditional Statements

Conditional statements let you return different values based on a test. The syntax is:

condition ? value-if-true : value-if-false

For example, qty > 2 ? 100 : 50 checks whether the response to the question with slug qty is greater than 2. If it is, the calculation returns 100. If not, it returns 50.

On this screen: The Calculation to be performed field contains a conditional expression such as qty > 2 ? 100 : 50. The right panel’s Operators section provides conditional and comparison operators. The slug qty appears in the Questions operands list on the right.

After you calculate the survey in a project, expand Calculations on the recommendations step.

On this screen: The Calculations section opens to a table with Calculation Name and Calculated Value. For this example, the value is 100 when the quantity entered is greater than 2.

New to ScopeStack?

ScopeStack automates scoping, pricing, and SOW generation for IT services teams. See how it fits your process.

Book a demoBrowse the docs
Last updated on