﻿---
title: ES|QL ABSENT function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2986/reference/query-languages/esql/functions-operators/aggregation-functions/absent
products:
  - Elasticsearch
---

# ES|QL ABSENT function
<applies-to>
  - Elastic Stack: Generally available since 9.2
</applies-to>


## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2986/reference/query-languages/esql/images/functions/absent.svg)


## Parameters

<definitions>
  <definition term="field">
    Expression that outputs values to be checked for absence.
  </definition>
</definitions>


## Description

Returns true if the input expression yields no non-null values within the current aggregation context. Otherwise it returns false.

## Supported types


| field                                                                        | result  |
|------------------------------------------------------------------------------|---------|
| aggregate_metric_double                                                      | boolean |
| boolean                                                                      | boolean |
| cartesian_point                                                              | boolean |
| cartesian_shape                                                              | boolean |
| date                                                                         | boolean |
| date_nanos                                                                   | boolean |
| dense_vector                                                                 | boolean |
| double                                                                       | boolean |
| exponential_histogram <applies-to>Elastic Stack: Preview in 9.3</applies-to> | boolean |
| geo_point                                                                    | boolean |
| geo_shape                                                                    | boolean |
| geohash                                                                      | boolean |
| geohex                                                                       | boolean |
| geotile                                                                      | boolean |
| histogram <applies-to>Elastic Stack: Preview in 9.3</applies-to>             | boolean |
| integer                                                                      | boolean |
| ip                                                                           | boolean |
| keyword                                                                      | boolean |
| long                                                                         | boolean |
| tdigest <applies-to>Elastic Stack: Preview in 9.3</applies-to>               | boolean |
| text                                                                         | boolean |
| unsigned_long                                                                | boolean |
| version                                                                      | boolean |


## Examples

```esql
FROM employees
| WHERE emp_no == 10020
| STATS is_absent = ABSENT(languages)
```


| is_absent:boolean |
|-------------------|
| true              |

To check for the absence inside a group use `ABSENT()` and `BY` clauses
```esql
FROM employees
| STATS is_absent = ABSENT(salary) BY languages
```


| is_absent:boolean | languages:integer |
|-------------------|-------------------|
| false             | 1                 |
| false             | 2                 |
| false             | 3                 |
| false             | 4                 |
| false             | 5                 |
| false             | null              |

To check for the absence and return 1 when it's true and 0 when it's false you can use to_integer()
```esql
FROM employees
| WHERE emp_no == 10020
| STATS is_absent = TO_INTEGER(ABSENT(languages))
```


| is_absent:integer |
|-------------------|
| 1                 |