> For the complete documentation index, see [llms.txt](https://docs.cascade.io/cascade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cascade.io/cascade/cascade-faqs/functions-and-expressions/how-to-replace-null-values-with-0.md).

# How to replace null values with 0

By utilizing an [IF](/cascade/functions-and-expressions/functions/logical/if.md) Statement in conjunction with [ISNULL](/cascade/functions-and-expressions/functions/logical/isnull.md), you can easily replace any null values with 0.

<figure><img src="/files/nWB5qUgdkFnEb79bE6xm" alt=""><figcaption><p>Null values in a table</p></figcaption></figure>

The syntax for this is simply: IF(ISNULL(\[column]), 0, \[column]).

<figure><img src="/files/Svh4FqMJrts6rDUeylVe" alt=""><figcaption><p>Using the Expression Editor to write an <a href="/pages/-MYYVdWp5hn-zzPxldsW">IF</a> statement</p></figcaption></figure>

This statement will check to see if the value is null. If it is, it will replace it with 0; on the other hand, if not, it will preserve the original value in the column being tested.

<figure><img src="/files/odtcbHmohJgIvKYiTFFW" alt=""><figcaption><p>All null values are replaced with a zero in a calculated column</p></figcaption></figure>

{% hint style="info" %}
Remember to use the [Edit Columns](/cascade/tools/transform/editcolumns.md) tool to add a new calculated column with the [ISNULL](/cascade/functions-and-expressions/functions/logical/isnull.md) function.
{% endhint %}

## Another Method - [Find Replace](/cascade/tools/cleaning/findreplace.md)

You may also find it easier to use a [Find Replace](/cascade/tools/cleaning/findreplace.md) tool to replace all null values in the entire table, or in specific columns with your desired value; in our case, 0.

<figure><img src="/files/3XcvF6xZ2DKsCaQAe2ol" alt=""><figcaption><p>All null values are replaced with a zero in their origin column</p></figcaption></figure>

### Related Questions

<details>

<summary>How can I substitute null values with 0?</summary>

You can substitute null values with 0 by using an IF Statement in conjunction with ISNULL, or by using the Find Replace tool.

</details>

<details>

<summary>What is the IF syntax for replacing null values with 0?</summary>

The syntax to include in an IF statement to replace null values with 0 is IF(ISNULL(\[column]), 0, \[column]).

</details>

### Other Sources

{% content-ref url="/pages/-MYYVdWp5hn-zzPxldsW" %}
[IF](/cascade/functions-and-expressions/functions/logical/if.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MYYX6Wm4hzIuIl0L3dq" %}
[ISNULL](/cascade/functions-and-expressions/functions/logical/isnull.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MYR43cW3b1-7XM\_2Tsx" %}
[Find/Replace](/cascade/tools/cleaning/findreplace.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cascade.io/cascade/cascade-faqs/functions-and-expressions/how-to-replace-null-values-with-0.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
