CASE

CASE WHEN [Status] == 'In Dev' THEN 'In Progress' WHEN [Status] == 'In Testing' THEN 'In Progress' ELSE 'Done'

Syntax

CASE WHEN (logical expression) THEN (expression to return) ELSE (expression to return)

The CASE function goes through conditions and return a value when the first condition is met.

logical expression: An expression that produces a Boolean value when evaluated, i.e. one of TRUE or FALSE. The combination of data fields, constants, text, numeric and date expressions with logical operators >,<,>=, <=, != and etc. can be used to create logical expressions

expression: Any numerical, date or logical expression can be used

Use cases

Chrome total domination

Compare chrome browser usage vs all other browsers usage.

Source: Browsers

Browser usage stats of the product in last month

BrowserSessionsUsers
Chrome63951105
Firefox376104
Safari28874
Edge21561
Opera3711
Internet Explorer3210
YaBrowser155

Chart STACKED-BAR

X: CASE WHEN [Browser] != 'Chrome' THEN 'Others' ELSE 'Chrome'

Y: SUM([Users])

COLOR: [Browser]

LABEL: [Browser]

Chart

CASE WHEN Browser != 'Chrome' THEN 'Others' ELSE 'Chrome'SUM(Users)Browser
Others74Safari
Others104Firefox
Others61Edge
Others11Opera
Others5YaBrowser
Others10Internet Explorer
Chrome1105Chrome