# Qlik Sense Null Functions – IsNULL and NULL

Job-ready Online Courses: Knowledge Awaits â€“ Click to Access!

## 1. Objective

In our last Qlik Sense Tutorial, we discussed Qlik Sense Mapping Functions. In this Qlik Sense Null Functions tutorial, we will talk about NULL functions which we use to detect and return NULL values, if present in the data record. You were introduced to the concept of NULL values in the QlikView tutorials. So, the null values are such places or cells in a data table or record which contain no data value of any sorts and are thus called NULLs or nothingness. Even though they contain no value, these values are of some significance in Qlik Sense, and for that, the two functions, IsNull() function and NULL() functions. Â

So, let’s start Qlik Sense Null Functions Tutorial.

Qlik Sense Null Functions – IsNULL and NULL

## 2. Qlik Sense Null Functions

### i. IsNull() function

The IsNull() function checks the values for Null and returns -1 (True) if it is Null and 0 (False) if it is not Null. This function evaluates an expression logically and answers in -1 or 0.

Have a look at Qlik Sense Scatter Plot

The syntax of Qlik Sense IsNull Function:

`IsNull(expression)`

For example, we load a table inline called NullsDetect where we have loaded some values in two columns and four rows where some actual data values and some null values have been loaded. Now, the resultant table which will be made will have three columns, for ID, Value and IsItNull which returns T if a value is Null and F if it is not.

```NullsDetect:
If(IsNull(Value), 'Yes', 'Noâ€™) as IsItNull;
[ID, Value
0,
1,NULL
2,-
3,Mark];```

Resultant table,

 ID Value IsItNull 0 Yes 1 NULL Yes 2 – Yes 3 Mark No

So, in the sample code given, the IsNull(Value) function first evaluates the values in the column â€˜Valueâ€™ to detect Null. And then in the resultant table, we get three Ts because first three values are Null and the last one â€˜Fâ€™ as Mark is a string value and not a Null value. In the systemâ€™s logic the True or T is recorded as -1 and False, or F is returned as 0.

### ii. NULL() function

This function returns a null value. It is different from IsNull function as that returns a logical answer in True or False, whereas NULL() function returns â€˜-â€˜ in place of a null value.

Do you know about Qlik Sense Line Chart

The syntax of Qlik Sense Null Functions:

`Null()`

For instance,

In the script given below, we will use the values in the column â€˜Valueâ€™ in the table loaded inline which are a mix of nulls and other (numeric or string) values. Using the Null() function, we will see which values are actually null and which are not.

```NullsConvert:
If(len(trim(Value))= 0 or Value='NULL' or Value='-', Null(), Value ) as ValueNullConv;
[ID, Value
0,
1,NULL
2,-
3,29
4,Mark];```

Resultant table,

 ID Value ValueNullConv 0 – 1 NULL – 2 – – 3 29 Value 4 Mark Value

Thus, as you can see in the table, the data values in the field â€˜Valueâ€™ gets evaluated by the Null() function which returns â€˜-â€˜ if a null is encountered and returns â€˜Valueâ€™ if a string or numeric value is encountered.

Let’s revise Qlik Sense Conditional Functions

So, this was all in Qlik Sense Null Functions. Hope you like our explanation.

## 3. Conclusion

Thus, in this Qlik Sense Null Functions article, we learned about how the two null functions deal with null values. As the IsNull() is a function that logically evaluates a set of values and returns -1 or 0 for if a value is null or not. On the other hand, the Null() function detects the null values from a data set and returns â€˜-â€˜ symbol in its place.

Still, if you have any query regardingÂ Qlik Sense Null Functions, ask in the comment tab.

Qlik Sense Gauge Chart

Reference for Qlik Sense

DataFlair Team

The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.

### 2 Responses

1. Ravi Kumar Chodipilli says:

Can I know we we use this is null

2. Ravi Kumar Chodipilli says:

Can I know when we use