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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator III

IF(ISNULL... working for one field but not the other!

I have four lines in my load script.

     [table1.ONumber] AS [O Number]

     if(isnull([table1.ONumber]),'Missing','Ok') AS [T1O Check],

and

     [table2.PNumber] AS [P Number]

     if(isnull([table2.PNumber]),'Missing','Ok') AS [T2P Check],

The first one returns data as it should

O Number     T1O Check

OO 123 IM    Ok

OO 435 IM    Ok

                    Missing

OO 358 IM    Ok

OO 329 IM    Ok


However the second one isn't treating the nulls as it should


P Number     T2P Check

PP 123 IM    Ok

PP 435 IM    Ok

                    

PP 358 IM    Ok

PP 329 IM    Ok



The code works fine if used in an expression in a straight table chart, just not in my load script.

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table1:

LOAD

     [table1.ONumber] AS [O Number],

     if(isnull([table1.ONumber]),'Missing','Ok') AS [T1O Check]

FROM

C:\Users\abc\Desktop\table1.qvd (qvd);

Left Join (Table1)

LOAD [table2.PNumber] AS [P Number]

FROM

C:\Users\abc\Desktop\table2.qvd (qvd);


ResultTable:

NoConcatenate

LOAD *,

          if(isnull([P Number]),'Missing','Ok') AS [T2P Check]

Resident Table1;

DROP Table Table1;

View solution in original post

18 Replies
Anonymous
Not applicable

if(field name ='value',give the condition, given condition,

if(field name='value' give the condition, give condition))

alexandros17
Partner - Champion III
Partner - Champion III

Maybe you have no null values, try to add this piece of code:

if(isnull([table2.PNumber]) or Trim([table2.PNumber])='','Missing','Ok') AS [T2P Check])


let me know

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this: If(Len(Trim([table2.PNumber]))=0,'Missing','Ok') AS [T2P Check],


talk is cheap, supply exceeds demand
matthewp
Creator III
Creator III
Author

Still the same issue

matthewp
Creator III
Creator III
Author

Still the same issue

matthewp
Creator III
Creator III
Author

The code works fine if used in an expression in a straight table chart, just not in my load script.

matthewp
Creator III
Creator III
Author

The code works fine if used in an expression in a straight table chart, just not in my load script.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't see how that's possible unless you have very strange characters in that field. Please post a small qlikview document that demonstrates the problem.


talk is cheap, supply exceeds demand
sunny_talwar

Can you do something like this:

Ord([table2.PNumber]) as Character to check what exactly it is that is hidden?