Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
Returns the value of then if if evaluates to true
,
or the value of else otherwise.
An alias for iff()
.
iif(
if,
then,
else)
Name | Type | Required | Description |
---|---|---|---|
if | string | ✓ | An expression that evaluates to a boolean value. |
then | scalar | ✓ | An expression that gets evaluated and its value returned from the function if if evaluates to true . |
else | scalar | ✓ | An expression that gets evaluated and its value returned from the function if if evaluates to false . |
This function returns the value of then if if evaluates to true
,
or the value of else otherwise.
StormEvents
| extend Rain = iif((EventType in ("Heavy Rain", "Flash Flood", "Flood")), "Rain event", "Not rain event")
| project State, EventId, EventType, Rain
Output
The following table shows only the first 5 rows.
State | EventId | EventType | Rain |
---|---|---|---|
ATLANTIC SOUTH | 61032 | Waterspout | Not rain event |
FLORIDA | 60904 | Heavy Rain | Rain event |
FLORIDA | 60913 | Tornado | Not rain event |
GEORGIA | 64588 | Thunderstorm Wind | Not rain event |
MISSISSIPPI | 68796 | Thunderstorm Wind | Not rain event |
... | ... | ... | ... |