Sample variance.
| Field | Value |
|---|---|
| Category | Statistics |
| Type | Aggregation (operates on a set of rows) |
| Arity | 1 argument (fixed) |
| Compiles to SQL (calculated column) | Yes |
| Version | Formula engine v3. |
Aliases#
Canonical name: VAR. Accepted aliases (case-insensitive): variance.
Syntax#
code
VAR(coluna)The 1st argument is the name of a column (bare identifier); the others are expressions.
Returns#
Number.
Null handling#
Blank values are IGNORED (they don't count as zero); a group with no values returns blank.
Evaluation context#
Aggregation — goes through the rows of the visual's current group.
Differences from DAX#
- DAX equivalent: VAR.S
- Compatibility: DIFFERS from DAX — different semantics, watch out
- Note: Here VAR is the sample VARIANCE (n-1). CAREFUL:
VARis also the variable declaration keyword —VAR(ticket)is variance,VAR meta = 1000; RETORNAR ...is a variable. In DAX, VAR is only the keyword; variance is VAR.S/VAR.P.
Examples#
code
VAR(ticket)Example with values#
Input: column v = 2, 4, 6 (sample variance).
code
VAR(v) → 4Expected result: 4
Business example#
Summarize a period — total revenue, average ticket, spread of the value per order.
Common errors#
Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.