---
schema_version: "1"
id: 2f8e0fc04477a538df3ea90a6650e2a825078a6cf1977a16dc4d58896050c590
title: Null Operators
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-operators-null.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-null.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: af553e32d5bc88fdaff441ee109e31e141905dbaf470628def90f2910c67715c
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Null Operators

Use `is null` and `is not null` to check whether a value is or is not null. `is null` returns `True` when a value is null. `is not null` returns `True` when a value is not null.

This example returns rows that contain `Sub_Category` fields that are not null and the counts of rows that contain each field.

```nolang
q = load "Superstore";
q = filter q by 'Sub_Category' is not null;
q = group q by 'Sub_Category';
q = foreach q generate 'Sub_Category' as 'Sub_Category', count() as 'count';
q = limit q 2000;
```

| Sub-Category | Count of Rows |
| ------------ | ------------- |
| Accessories  | 775           |
| Appliances   | 466           |
| Art          | 796           |
| Binders      | 1,523         |
| Bookcases    | 228           |
| Chairs       | 617           |
| Copiers      | 68            |
| Envelopes    | 254           |
| Fasteners    | 217           |
| Furnishings  | 957           |
| Labels       | 364           |
| Machines     | 115           |
| Paper        | 1,370         |
| Phones       | 889           |
| Storage      | 846           |
| Supplies     | 190           |
| Tables       | 319           |

## Replace Null Values with case

Use `case` to replace null values with a value of your choice. This example labels the null `Sub-Category` field "Empty."

```nolang
q = load "Superstore";
q = group q by 'Sub_Category';
q = foreach q generate case when 'Sub_Category' is null then "Empty" else 'Sub_Category' end as 'Sub_Category', count() as 'count';
q = limit q 2000;
```

| Sub-Category | Count of Rows |
| ------------ | ------------- |
| Accessories  | 775           |
| Appliances   | 466           |
| Art          | 796           |
| Binders      | 1,523         |
| Bookcases    | 228           |
| Chairs       | 617           |
| Copiers      | 68            |
| Envelopes    | 254           |
| Fasteners    | 217           |
| Furnishings  | 957           |
| Labels       | 364           |
| Machines     | 115           |
| Paper        | 1,370         |
| Phones       | 889           |
| Storage      | 846           |
| Supplies     | 190           |
| Tables       | 319           |
| Empty        | 4             |

**See Also**

- [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-filter.md)
- [group-by rollup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby-rollup.md)
- [group-by](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby.md)
