Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 442 Bytes

File metadata and controls

23 lines (19 loc) · 442 Bytes

Case

Search for the first condition that evaluates to true and return its associated value. If none of the conditions match, null is returned.

from employees
derive distance = case [
  city == "Calgary" => 0,
  city == "Edmonton" => 300,
]

To set a default, a true condition can be used:

from employees
derive distance = case [
  city == "Calgary" => 0,
  city == "Edmonton" => 300,
  true => "Unknown",
]