Loading...

Form-Based Computed Values

A computed value allows you to input formulas that include other form fields on your Worksheet.  That means you can automatically calculate averages, sums, and so on, and, of course, pipe these into Metrics.

Let's take a look at one in action...

I'd like to know how a given client feels on average about a topic on this Worksheet.
Screenshot_2025-03-31_at_4.55.34PM.png
I've already got three questions that address that opinion, so I will take the average of these to get the person's general feeling.

Create Fields First

Step 1 is to create the form-based fields you'll use in the computed value. Basically, the system has to know what it's supposed to add/subtract/multiply/divide. It's like baking: you can't start with the step that says "mix all the ingredients into the bowl" without knowing what the ingredients are. 
Screenshot_2025-03-31_at_5.05.04PM.png

Step 2 is to create a computed value. Use the Form Items button on the toolbar, the same way you did for the other form fields.
Screenshot_2025-03-31_at_5.09.59PM.png
See the options for values to include in this formula, those clickable green links? They are all from the same Worksheet I'm working on. That's why it's so important to create these fields in advance.

Now, just click on any of those to add it to your formula. 

Since I want the average, I need to add the three fields together, then divide by three. CA know PEMDAS, so using parentheses makes usre that the adding gets done before the dividing.
Screenshot_2025-03-31_at_5.08.42PM.png
I don't want my client to see this field because I only want to use it to pipe into a Metric (another reason you may not want clients to see the computed value is if you're just keeping this number for yourself), so I leave the 'Visibility' box unchecked. 

You can always run a report on just this field by using the Data Lab Single Field reporting function.

You'll name this field as well. The name should be something you'd use as a title in a spreadsheet column. 

Let's build a Metric that pipes in the data from this computed value field.
Picture1.png
And voila! You've got magically appearing Metric data from a question your client didn't even know she answered.  By the same token, it's often nice to have a computed value show right within the Worksheet.  That value will magically update itself as your client fills out the other parts of the worksheet that are part of the formula. This can be nice for a total score that grows as your client answers the questions. 

Which functions can a CA computed value do?


Pretty much any valid mathematical expression of arithmetic will work! This includes:
  • Parentheses
  • Exponents
  • Multiplication
  • Division
  • Addition
  • Subtraction

Computed Value Formula Errors

If the formula you've typed is invalid (perhaps some parentheses don't match up or you've got a typo in your input names), the system will let you know immediately so you can make corrections.

Related: