Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

Regarding Null

Hi ALL,

When i am writing the Or after IsNull(DD_TYPE) then it is fetching the rows....but when i am writing "and" after IsNull(DD_TYPE) nothing is getting fetched ....i dont know what happming exactly .....is i am doing wrong please suggest me right answer....

Below is my code ...i want all the null  records in my report ....

IsNull(DD_TYPE) and

WildMatch(DD_TYPE,'EN','NB','RW','RO','UC')

Please reply its urgent ......

Sarfaraz

12 Replies
salto
Specialist II
Specialist II

Hello Sarfaraz,

     Correct me if I am wrong but, if DD_TYPE is null, it will never match any value like 'EN', 'NB' os something similar, because it is a null value.

Hth.

MK_QSL
MVP
MVP

Use Match Instead of WildMatch

and

Instead of using IsNull Try to create a Flag for Null in Script

If(IsNull(DD_TYPE) or Len(Trim(Replace(DD_TYPE,'-','')))=0, 1, 0) as DDTypeNullFlag

......

Also, use

If(IsNull(DD_TYPE)) OR

If(WildMatch(DD_TYPE,'EN','NB','RW','RO','UC'))

vardhancse
Specialist III
Specialist III

The data in a field will be either 'Null' or a value. But can not be both.

what ever we use WildMatch or Match..

And so in AND condition both the conditions are not satisfied. so showing no rows.

only in OR condition we its possible to get some records.

hic
Former Employee
Former Employee

If you want the records where DD_TYPE is NULL, you should use

     Where IsNull(DD_TYPE)

or

     Where Len(Trim(DD_TYPE)) = 0

and no additional condition. (See Jose's answer above).

If you don't get the records you want, you can debug by removing this condition from the where-clause and put it in a field instead:

     IsNull(DD_TYPE) as DebugField

HIC

michael_anthony
Creator II
Creator II

Is this in your script or a chart expression.  Assuming script, what is in the source record.  Eg. An empty string may not return Null.  Also why are you testing IsNull and Wildmatch.  What is in the source and what are you trying to achieve.

If a record was Null and so true, then wildmatch would find no match and return 0 which is interpreted as false.  So can never satisfy the AND.

sarfaraz_sheikh
Contributor III
Contributor III
Author

dear all,

I want both in my record null record as well as contains Value record what shoud i have to do ,,,please tell its urgent...

Sarfaraz

hic
Former Employee
Former Employee

If you want both records with NULL and records with an other value, you should use OR (what you initially suggested):

IsNull(DD_TYPE) or WildMatch(DD_TYPE,'EN','NB','RW','RO','UC')

HIC

PrashantSangle

Hi,

Can you explain your requirement with example?

It looks easy to solve.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sarfaraz_sheikh
Contributor III
Contributor III
Author

You are write mr. henric.....but how i can identify that the particula recontans null value....because i am unable to find the null records in application......

Sarfaraz