Skip to main content

pct

pct(<bool-expression>)

Returns a percent of all records where the input expression returns true.

If the input expression returns null for a record, that record is excluded from the calculation.

Examples:

pct(q1==1)
pct(q1 in (8,9,10))
pct(country=="USA")
pct(country=="USA" and gender==1)

The return value is structured as follows:

{
val: 0.1277666, // return value (percentage)
freq: 127, // number of records where expr returned true
n: 994 // number of valid (non-null) cells
}