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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Blanks in field-can not modify: IS null,=null, or len identifier not working

Every [part number] should have a [Commodity Code] however when the [Commodity Code] is blank, isnull, or [Commodity Code]=null() or if(len([Commodity Code])<2,1,0) doesnt work.

Please see my qvw attached.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Only an idea: If you might have varying number of spaces, you could use one of the trim functions:

=if(trim([Commodity Code])='','BLANK',[Commodity Code])

View solution in original post

3 Replies
Not applicable
Author

Hi Joseph,

For the [part numbers] that appear to return no [Commodity Code] in the data, it looks like in fact they are returning 3 spaces instead.

As a result of the rows containing 3 spaces, this is why they are not satisfying the isnull() function or the

if(len([Commodity Code])<2,1,0).

Perhaps try

if([Commodity Code])='   ',1,0)   using 3 spaces in between the ' '

Have attached a table of your data...

Hope this helps?

Kind regards,


Rich

swuehl
MVP
MVP

Only an idea: If you might have varying number of spaces, you could use one of the trim functions:

=if(trim([Commodity Code])='','BLANK',[Commodity Code])

Not applicable
Author

when i used =if(len(trim([Commodity Code]))<2'','BLANK',[Commodity Code])

it worked.  Also, RichSheppard's input was very helpfuul and explains why my original formula didnt work.