Consider the following table:
myTable:
a b
-------
1
2
3 10
4 50
5 30
How do I replace the empty cells of b
with a zero? So the result would be:
a b
-------
1 0
2 0
3 10
4 50
5 30
Right now I'm doing:
myTable: update b:{$[x~0Ni;0;x]}'b from myTable
But I am wondering whether there is a better/easier solution for doing this.
Using the fill operator (
^
)Example Table:
Fill nulls in all columns with 0:
Fill nulls only in selective columns with 0:
In some cases when you want to fill the null values from the previous non-null value, you can use
fills
functions.using
fills
with aggregation