How computed questions work
- A formula can only read answers from the same review form. It cannot read answers from other stages, other reviewers, feedback, or goals.
- Windmill calculates the answer each time the reviewer saves a draft. The reviewer cannot change the answer.
- A computed question is never required, because its answer can be empty.
- A formula can read other computed questions. A formula cannot read itself, directly or through other questions.
- A form must have at least one question that the reviewer answers.
Example
A manager review has two Rating questions: Quality of work (question 1) and Impact (question 2). You want an overall score that gives 60% weight to quality and 40% weight to impact, with one decimal place:Add a computed question
You can add computed questions to Self, Peer, Manager, and Upward review stages. You can add them when you create a cycle, when you edit a recurring review, or on the questions page of an existing stage. Only cycle admins can add or change computed questions.Open the questions for a stage
Click Add question, then select Computed
Enter a title and description
Select the answer type
Write the formula
Test the formula in the preview
Click Apply formula, then save
Choose an answer type
In Answer type, select one of these types:- Number: The default type. You can set a Range with a Min and Max, a Unit, and Whole numbers only.
- Single select: The formula gives one of the options of this question. Add the options in the options editor.
- Yes/No: The formula gives yes or no.
- Text: The formula gives text, for example a label that you join from other answers.
Show or hide the formula from reviewers
Show the formula to reviewers is on by default. When it is on, reviewers see the formula when they hover over the computed answer. When it is off, reviewers see only the answer.Write a formula
Let Windy write the formula
Describe the calculation
Click Write formula
Click Use formula or Discard
Type a formula
Click Show formula to open the formula editor. Use Add a variable to insert a reference to a question. Function names are not case-sensitive. ReferencesANSWER("Q1"): The answer to question 1. The number is the position of the question in the form, and computed questions count too. Reviewers see no numbers on computed questions, so this number can be different from the number that reviewers see.OPTION("Q1", "Label"): One of the options of question 1. Only Single select, Multi-select, and Rating questions have options. For a Rating question, an option gives its point value.
- Numbers, text in straight double quotes (
"text"),TRUE,FALSE, andNULL. - Lists in square brackets, for example
[ANSWER("Q1"), ANSWER("Q2")].
- Arithmetic:
+,-,*,/,%,^ - Comparison:
==,!=,<,<=,>,>= - Logic:
AND,OR,NOT
Use conditions
IF(condition, result, else result)gives one of two results. You can also writeIF condition THEN result ELSE result END, with moreELSE IFparts.MAP(input, [[key, result], ...], else result)gives the result for a matching key.BAND(input, [[upper limit, result], ...], else result)gives a result for a range of numbers. Each upper limit is not included in its band. Put the limits in ascending order.
Questions a formula can read
- Number, Scale, eNPS, and Rating: Read as numbers.
- Single Select and Multi-Select: Read as options.
- Yes/No: Read as
TRUEorFALSE. - Text: Read as plain text.
Test the formula in the preview
The Preview panel shows a field for each question that the formula reads. Enter example answers to see the Result. If there is no result, the preview tells you why:- An answer that the formula needs is empty.
- An answer that the formula reads does not fit its question.
- The result does not fit the answer format of this question.
- Division by zero.
Answer a review with computed questions
Reviewers do not answer computed questions. The computed answer shows as a read-only tag with a formula icon.- Updates: Windmill recalculates the answer each time the review saves. While it saves, the earlier answer shows dimmed. If there is no earlier answer, it shows Updating….
- Empty answers: If the formula gives no result, the computed answer shows Not available yet. For example, an answer that the formula needs is empty, or the formula divides by zero. It updates when the reviewer answers the questions that the formula reads.
- Formula details: If the formula is visible, the reviewer can hover over the answer to see how Windmill calculated it. For a weighted score, the tooltip shows each question, its answer, its weight, and the total.
See computed answers in results
- Review packets: Computed answers show in review packets with the other answers from their stage. If you add a computed question after the cycle is created, employees cannot see it until you add it to the employee packet in the packet settings. The question editor shows this note on a new computed question.
- Calibration: Facilitators cannot change a computed answer directly. When they change an answer that the formula reads, the computed answer updates. In the table view, hover over the answer to see its earlier value.
- Insights: Computed answers show with a formula icon.
Change computed questions after launch
Cycle admins can add, remove, and change computed questions on a live cycle, because Windmill recalculates their answers. This includes cycles after a stage starts and completed cycles. You cannot change questions on an archived cycle. When you change a formula, Windmill recalculates the answer in every review in the stage, including submitted reviews. You cannot change a manual question to a computed question, or a computed question to a manual question, after the stage starts. For other limits on changes, see Questions and rating scales.FAQs
Can a reviewer change a computed answer?
Can a reviewer change a computed answer?
How do I give questions different weights?
How do I give questions different weights?
ANSWER("Q1")*0.6 + ANSWER("Q2")*0.4. If the weights are positive and add up to 1, reviewers see them as percentages when they hover over the answer.What happens when an answer is empty?
What happens when an answer is empty?
AVG, TOTAL, MIN, and MAX give an empty result if any item in the list is empty. A blank Text answer is empty. To use a default value, use IFNULL, for example IFNULL(ANSWER("Q1"), 0).How does rounding work?
How does rounding work?
ROUND(value, digits) rounds half away from zero. For example, ROUND(2.5, 0) gives 3. The digits can be from -14 to 6.What happens if I delete a question that a formula reads?
What happens if I delete a question that a formula reads?
Can a formula use answers from a different stage?
Can a formula use answers from a different stage?
Why does the save bar say to apply the formula?
Why does the save bar say to apply the formula?