Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to interpret a value as Null from Database?

Hi,

Using NullInterpret, we can interpret any value as a null value. Example, '+' can be interpreted as a null value using the NullInterpret variable. But by definition of Nullinterpret,

"The defined symbol will when it occurs in a text file or an inline statement be interpreted as NULL."

So, if I want to interpret something ('+') from the database, how can we do that? is there any variable similar to Nullinterpret or we need to handle that logically using If statement?

Thanks

14 Replies
Anonymous
Not applicable
Author

Thank you so much Stefan

johanlindell
Partner - Creator II
Partner - Creator II

There is a function to check if a value is a number, IsNum. You can use that:

LOAD Year,

      If (IsNum(Amount), Amount, Null ()) as Amount,

xxx

Anonymous
Not applicable
Author

Yes, this logic also works. Thanks Johan

Anonymous
Not applicable
Author

Try this Karthick Sudalaiyandi:

On load the script do

If(FindOneOf(Amount,'+-><') > 0 , 'NULL',Amount) AS Amount

In the red part put the possible characters that will be considered null.

Digvijay_Singh

Sweet!!! Thanks as always!!!!