This article provides step-by-step calculation examples for common scenarios in Brilliant Assessments, including arithmetic from answers, score conversions, conditional logic, and date calculations. Use it as a companion to the Setting Up Calculations reference article.
Tip: If you are new to calculations, start by reading Setting Up Calculations for Assessments first. It explains the builder interface, selectors, and settings you will use in every example below.
On this page
- Before you start
- Example 1: Simple arithmetic from answers
- Example 2: Working with total points in a calculation
- Example 3: Conditional logic driver (show or hide sections)
- Example 4: Assigning rating text with Case/When
- Example 5: Calculating days between dates
- Example 6: Rounding and formatting numbers
- Quick reference: Common patterns
- FAQs & Troubleshooting
Before you start
Score selectors and how they are returned:
- The Assessment Score, Section Score, Subsection Score and Theme Score selectors return a percentage, stored as a decimal value. For example, a score of 60% is returned as 0.60.
- The Total Score selectors (Assessment, Section, Subsection and Theme) return the sum of the points achieved, and the Average Score (points) selectors return the average points per question. These return points directly, so no conversion is needed.
- When comparing scores in formulas, always use decimal values (for example,
> 0.60), not whole numbers (for example,> 60). - To work in points rather than percentages, use the Total Score or Average Score (points) selectors. Multiplying a percentage score back up is no longer necessary.
Result Calculation vs Score Calculation:
Every calculation has two formula boxes. The examples in this article use one or both depending on the scenario.
-
Result Calculation (top box) - generates a text or numeric value for reporting purposes. Display it using an
AnswerTextmerge string. - Score Calculation (bottom box) - generates a numeric value that contributes to scoring. Requires Max Points and should be linked to a theme.
If a calculation depends on the result of another calculation, place it in a separate subsection after the calculation it depends on. This ensures calculations execute in the correct order.
For a full explanation of both boxes and when to use each, see Setting Up Calculations for Assessments.
Tip:
To start building a formula, click the New Line button first. This creates the first line in the formula builder where you can begin adding tiles.
- Ensure you have populated the Test Response with sample answers so you can use the Test button to verify your formula.
Example 1: Simple arithmetic from answers
Scenario
Your assessment collects Annual Revenue and Annual Expenses as numeric answers. You want to calculate profit and display it in the feedback report.
Formula
Using the Answer Text selector, insert the two answer tiles with a minus operator between them:
{AnnualRevenue.AnswerText} - {AnnualExpenses.AnswerText}Setup
- Create a calculation in the same section as the revenue and expense questions (or any later section).
- Build the formula: Select Answer Text for the revenue question, then the - operator, then Answer Text for the expenses question.
- Set the result format: Check Result is Numeric, set Format to Currency, and Decimals to 2.
- Leave Calculate after Scoring unchecked (this formula uses answer values, not scores).
- Test the formula using the Test button. If your test response has Revenue = 500000 and Expenses = 350000, you should see 150,000.00.
Displaying in the report
Use the calculation's Question Number (shown at the top of the Modify Calculation pop-up) in a merge string to display the result. For example, if the calculation number is Q15 (in Section 2, Subsection 1):
{ResponseAnswer.AnswerText[S2 SS1 Q15]}
Example 2: Working with total points in a calculation
Scenario
A total point score is built in. To report "45 out of 50" for a section, use the Total Score merge type directly, with no calculation and no theme:
{RatingScore.Total[SectionNo=1]} out of 50See Reporting Total Scores for the full set of levels and parameters.
A calculation is still useful when you need to combine or transform totals. In this example, two sections are scored separately but reported as a single combined figure.
Formula
{Section1.TotalScore} + {Section2.TotalScore}Each part is inserted with the Section Total Score selector, which returns the sum of the points achieved for that section. Because the selector returns points directly, there is no percentage to multiply back up.
Setup
- Create a theme to hold the combined total. This theme is used purely for reporting purposes. See Themes for how to set one up.
- Create a calculation in a section that appears after the sections being scored, or at the end of the assessment. It is often a good idea to create a dedicated section at the end and select Individual Report as Section Type.
- Build the formula: In the Score Calculation part, use the Section Total Score selector to choose the first section, add the + operator, then use Section Total Score again for the second section.
- Set Max Points (Potential Points) to the combined maximum of the two sections, so the calculation can be rated.
- Link to the theme: Go to the Themes tab on the calculation and select the theme you created in Step 1.
- Test the formula. If the two sections scored 45 and 30 points, you should see 75.
Example 3: Use Calculation to drive conditional logic (show or hide sections)
Scenario
You want to show a "Development Recommendations" section only if the respondent scores below 60% on a Leadership competency section.
Formula
Case When {LeadershipCompetency.Score} < 0.60 Then 'true' Else 'false' EndSetup
- Create a calculation in a section that appears before the section you want to conditionally show, and after the section being scored.
-
Build the formula using these tiles:
-
Logic selector:
Case -
Logic selector:
When - Section Score selector: Choose the Leadership section
-
Operators selector:
< -
Free Text:
0.60 -
Logic selector:
Then -
Free Text:
true -
Logic selector:
Else -
Free Text:
false -
Logic selector:
End
-
Logic selector:
- Check Calculate after Scoring.
-
Do NOT check Result is Numeric (the result must be the text string
'true'or'false'). - Link the condition: Go to the "Development Recommendations" section settings, open Conditions, and select this calculation from the dropdown.
Tip: The calculation must return the literal text strings 'true' or 'false'. Returning a number like 1 or 0 will not work as a condition driver.
Example 4: Rating text based on multiple score conditions
Scenario
When you need rating text that depends on a combination of conditions across multiple sections, for example, you want to display different feedback text based on whether both a "Strategy" section and an "Execution" section scored high or low, this is where a calculation with Case/When becomes essential.
Formula
In this example, we check the scores of two sections and return different text for each combination:
Case
When {Strategy.Score} < 0.60 and {Execution.Score} < 0.60 Then 'Both areas need development. Focus on building foundational skills in strategy and execution before advancing.'
When {Strategy.Score} < 0.60 and {Execution.Score} >= 0.60 Then 'Your execution is strong, but strategic thinking needs work. Consider leadership training to strengthen planning skills.'
When {Strategy.Score} >= 0.60 and {Execution.Score} < 0.60 Then 'You have strong strategic vision but need to improve follow-through. Focus on project management and accountability practices.'
Else 'Excellent performance across both areas. You are well-positioned for senior leadership responsibilities.'
EndThis produces four possible outcomes based on the high/low combination of two section scores:
| Strategy | Execution | Rating text returned |
| Below 60% | Below 60% | Both areas need development... |
| Below 60% | 60% or above | Your execution is strong... |
| 60% or above | Below 60% | You have strong strategic vision... |
| 60% or above | 60% or above | Excellent performance across both areas... |
Setup
- Create the calculation in a section that appears after both the Strategy and Execution sections have been scored.
-
Build the formula. Use the New Line button before each
Whento keep the formula readable.- Line 1:
Case - Line 2:
When{Strategy Section Score}<0.60and{Execution Section Score}<0.60Then'Both areas need development...' - Line 3:
When{Strategy Section Score}<0.60and{Execution Section Score}>=0.60Then'Your execution is strong...' - Line 4:
When{Strategy Section Score}>=0.60and{Execution Section Score}<0.60Then'You have strong strategic vision...' - Line 5:
Else'Excellent performance across both areas...' - Line 6:
End
- Line 1:
- Check Calculate after Scoring.
- Do NOT check Result is Numeric (the result is a text string).
-
Use the Copy Last Line button after building the first
Whenline. Then delete the tiles that differ and replace them. This saves time when you have multipleWhenconditions with similar structure.
Displaying in the report
Use the calculation's question number in a merge string to display the rating text:
{AnswerText.Text[QuestionNo=XX]}
Replace XX with the calculation's number.
Tip: You can combine conditions across any score types - sections, subsections, themes, or even answer values. For example, When {Section1.Score} >= 0.70 and {Subsection3.Score} < 0.50 Then 'text' is a valid condition. You can also add more When lines to handle additional combinations.
Note:
- Case/When evaluates conditions in order and returns the first match. The
Elseat the end catches any combination not explicitly listed above it. - If you need rating text based on a single section's score only, use the system's built-in Ratings feature instead - no calculation needed.
- For more complex combinations (three or more sections with multiple rating bands each), see Displaying Rating Text Based on Score Combinations which uses a weighted-score approach that scales better.
Example 5: Calculating days between dates
Scenario
Your assessment collects a "Project Start Date" as an answer. You want to calculate the number of days between that date and today.
Formula
DateDiff(day, {ProjectStartDate.AnswerText}, GetDate())Setup
-
Build the formula using these tiles:
-
Functions selector:
DateDiff() -
Functions:
Day - Answer Text: Select the date question
-
Functions selector:
GetDate -
Operators selector: for parentheses
()
-
Functions selector:
- Set the result format: Check Result is Numeric
Tip: The date answer must be in a recognized date format (for example, DD/MM/YYYY or MM/DD/YYYY depending on your assessment's language settings). If the respondent enters a non-date value, the calculation will return an error.
Example 6: Rounding and formatting numbers
Scenario
You are calculating a ratio from two answer values and want to round the result to 2 decimal places within the formula itself (for example, to use the rounded value in a subsequent calculation).
Formula
Round({Revenue.AnswerText} / {Headcount.AnswerText}, 2)Setup
-
Build the formula: Use the Functions selector to insert
Round. Then build the division inside the parentheses, and add Free Text2as the second parameter (number of decimal places). -
Set the result format: Check Result is Numeric. The format and decimal settings on the calculation form control how the value displays. The
Roundfunction controls the actual value stored.
Note:
- If you only need to control how the value displays in the report, you can skip
Roundand just set Number of Decimals in the result format options. The system will round automatically for display. - Use
Round()when the rounded value needs to be used in another calculation or when precise rounding matters for the stored result.
Quick reference: Common patterns
| What you want to do | Formula pattern |
| Add or subtract answers | {Answer1.AnswerText} + {Answer2.AnswerText} |
| Show/hide based on score | Case When {Section.Score} < 0.60 Then 'true' Else 'false' End |
| Assign text label from score | Case When {S.Score} < 0.40 Then 'Low' When {S.Score} < 0.70 Then 'Mid' Else 'High' End |
| Days since a date | DateDiff(day, {DateAnswer.AnswerText}, GetDate()) |
| Round a result | Round({Value.AnswerText} / {Divisor.AnswerText}, 2) |
| Convert number to text | Cast({Calculation.Result} As varchar) |
| Total score (not percentage) |
{RatingScore.Total}
No calculation required. (See Reporting Total Scores ) |
FAQs & Troubleshooting
Use the questions below to troubleshoot common calculation issues.
Related articles
- Setting Up Calculations for Assessments - Full reference for the calculation builder interface and settings
- Reporting Total Scores - How to report the Total, the sum of the points achieved
- Displaying Rating Text Based on Score Combinations - Weighted score combinations with custom rating text
- Setting Up Validations - Input validation using the same formula framework
- Assessment Settings - Where to enable calculations for your assessment
Comments
0 comments
Please sign in to leave a comment.