Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where Field is Null not working

hello,

I have a table with articles, and each article has a code. this code is stored in another column.

ArticlesCode
Article 112345
Article 1
Article 1
Article 22345
Article 2

I try to only select the fields that have a code, but somehow I cannot select Null.

I tried this:

[FactuurNummerLeverancierTemp]:

LOAD

  invs1_ref as [DocumentNumber],

  invscs_order_no as [FactuurNummerLeverancier];

SQL SELECT * FROM INVS_DATA

WHERE INVS1_CO_SITE = '01'

  AND invscs_order_no IS NOT NULL

      AND INVS1_REC_TYPE = 2;

Not working.

I also tried len() > 0 in a resident load. nope

Please help.

5 Replies
Not applicable
Author

I think I found the problem.

Each empty field contains a number of empty spaces.

'                                   '

How can I exclude them?

swuehl
MVP
MVP

Within a QV Load statement, you can use trim() function.

tresesco
MVP
MVP

Try len() with trim(), like:

Len(trim(invscs_order_no))>0

Brice-SACCUCCI
Employee
Employee

Hi,

This is an SQL statement and is executed directly on the database.

'SELECT * FROM INVS_DATA 

WHERE INVS1_CO_SITE = '01' 

AND invscs_order_no IS NOT NULL 

AND INVS1_REC_TYPE = 2;'


Can you check the behaviour of the statement on your database using a SQL query tool?


Or, if you want to use the resident load after your initial SQL load, try Len( Trim( Field ) ) > 0.

Regards,

Brice

Anonymous
Not applicable
Author

I want select the values NULL and with the sentence "IS NULL" work fine