3/5

where(): count how many meet a threshold

Easy

Return how many scores are at or above ri!minimum.

You do not need the values to count them — the positions are enough.

Inputs

  • ri!scores — List of Integer
  • ri!minimum — Integer

ri! Rule Inputs

ri!scoresList of Integer
{
  60,
  45,
  72
}
ri!minimumInteger
60

Example 1 — Two qualify

Input: ri!scores
{
  60,
  45,
  72
}
Input: ri!minimum
60
Output:
2

Example 2 — None qualify

Input: ri!scores
{
  10,
  20
}
Input: ri!minimum
50
Output:
0

Example 3 — All qualify

Input: ri!scores
{
  5,
  6
}
Input: ri!minimum
1
Output:
2

Example 4 — Exactly on the threshold

Input: ri!scores
{
  49,
  50
}
Input: ri!minimum
50
Output:
1

Example 5 — No scores at all

Input: ri!scores
{}
Input: ri!minimum
50
Output:
0

Appian Expression Tips

  • • Use ri!variableName for rule inputs
  • • Use a!localVariables(local!x: …, body) for locals
  • • Use a!forEach(items: …, expression: fv!item) to iterate
  • • Use where() / reject(fn!isnull, list) to filter