Skip to content

Commit f69dd65

Browse files
authored
Add null to iff (#461)
1 parent 776490c commit f69dd65

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

apl/scalar-functions/conditional-function.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ keywords: ['axiom documentation', 'documentation', 'axiom', 'case', 'iff']
99

1010
| **Function Name** | **Description** |
1111
| ----------------- | ------------------------------------------------------------------------------------------------- |
12-
| [case()](#case) | Evaluates a list of conditions and returns the first result expression whose condition is satisfied. |
13-
| [iff()](#iff) | Evaluates the first argument (the predicate), and returns the value of either the second or third arguments |
12+
| [case](#case) | Evaluates a list of conditions and returns the first result expression whose condition is satisfied. |
13+
| [iff](#iff) | Evaluates the first argument (the predicate), and returns the value of either the second or third arguments |
1414

15-
## case()
15+
## case
1616

1717
Evaluates a list of conditions and returns the first result whose condition is satisfied.
1818

@@ -49,7 +49,7 @@ extend status_human_readable = case(
4949

5050
[Run in Playground](https://play.axiom.co/axiom-play-qf1k/query?initForm=%7B%22apl%22%3A%22%5B'sample-http-logs'%5D%5Cn%7C%20extend%20status_code%20%3D%20case(status_int%20%3D%3D%20200%2C%20'OK'%2C%20status_int%20%3D%3D%20201%2C%20'Created'%2C%20status_int%20%3D%3D%20301%2C%20'Moved%20Permanently'%2C%20status_int%20%3D%3D%20500%2C%20'Internal%20Server%20Error'%2C%20'Other')%22%7D)
5151

52-
## iff()
52+
## iff
5353

5454
Evaluates the first argument (the predicate), and returns the value of either the second or third arguments. The second and third arguments must be of the same type.
5555

@@ -76,4 +76,12 @@ iff(predicate, ifTrue, ifFalse)
7676
| project Status = iff(req_duration_ms == 1, "numeric", "Inactive")
7777
```
7878

79-
[Run in Playground](https://play.axiom.co/axiom-play-qf1k/query?initForm=%7B%22apl%22%3A%22%5B'sample-http-logs'%5D%5Cn%7C%20project%20Status%20%3D%20iff%28req_duration_ms%20%3D%3D%201%2C%20%5C%22numeric%5C%22%2C%20%5C%22Inactive%5C%22%29%22%7D)
79+
[Run in Playground](https://play.axiom.co/axiom-play-qf1k/query?initForm=%7B%22apl%22%3A%22%5B'sample-http-logs'%5D%5Cn%7C%20project%20Status%20%3D%20iff%28req_duration_ms%20%3D%3D%201%2C%20%5C%22numeric%5C%22%2C%20%5C%22Inactive%5C%22%29%22%7D)
80+
81+
<Note>
82+
To return a null value from `iff`, use `dynamic(null)`.
83+
84+
```kusto
85+
iff(condition, dynamic(null), value)
86+
```
87+
</Note>

0 commit comments

Comments
 (0)