Piping
Expressions
Calculate with answers: arithmetic, comparisons and conditional text.
Expressions use the {{e: … }} marker and can do arithmetic, comparisons and conditionals.
Respondent sees
You are a promoter.
| Category | Operators |
|---|---|
| Arithmetic | + - * / % ** |
| Comparison | > < >= <= == != |
| Logic | && || |
| Conditional | condition ? ifTrue : ifFalse |
- Add Expression opens the calculation editor.
- Choose a supported function, such as avg().
- Insert numeric answers as the function inputs, separated by commas.
Function reference
Functions take numbers or numeric answer references. Separate multiple inputs with commas.
| Function | Example | Result |
|---|---|---|
avg | avg(4, 5) | 4.5 |
sum | sum(4, 5) | 9 |
min | min(4, 5) | 4 |
max | max(4, 5) | 5 |
round | round(4.56) | 5 |
floor | floor(4.56) | 4 |
ceil | ceil(4.12) | 5 |
abs | abs(-3) | 3 |
round, floor, ceil and abs use one input. To round to two decimal places, use
round(value * 100) / 100; a second argument does not specify the number of decimals.
Use parentheses to make calculation order explicit, especially when combining powers with other operations.
Types and missing values
Use a numeric answer or extractor for calculations. + joins text when either input is text,
so "4" + 5 produces 45, while sum("4", 5) converts numeric text and produces 9.
Comparisons and conditions can also use numbers, quoted text and true / false.
A missing source is not automatically left out of a calculation. Preview blank inputs, zero and any path that skips the source. Division by zero is invalid. The field editor validates expressions; an expression that cannot be evaluated may appear as an empty result.
Both sides of && and || are evaluated. To guard a calculation such as division, use a conditional:
v:count != 0 ? v:total / v:count : 0, with the real references inserted by the picker.
Worked guides
Advanced piping
EssentialAdd calculated expressions and pipe values into numeric fields.
Compare plans