Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Avoiding Null in Text Object

Hi all,

How we can avoid Null() values in set analysis expressions.

We have a requirement, where we want distinct count of dim1, where dim2 should not be Null.

We have tried,

-     dim2={*}-{''}

-     dim2 = {'*?'}

-     Not IsNull(dim2)

all these expressions are not working in below case

count(distinct {<Expressions>}dim1)

Please assist.

Regards,

MK

11 Replies
sunny_talwar

Create a table with dim1 and dim2 as dimensions and use this as expression =Len(Trim(dim2) and check if you are getting any 0's in there

Not applicable
Author

Hi MK,

count(distinct {<dim2={"*"}>}dim1)


will select all values from dim2 and as such will not include an true null values from that field.

If this does not work then it means that rather than true null values in dim2, you potentially have zero length strings instead which you are calling nulls.

For something like that the below should work

count(distinct {<dim2={"=Len(dim2)>0"}>}dim1)


but what I would suggest first is to identify what 'nulls' you have, to know how best to deal with them, maybe have a look here

Finding NULL

NULL – The Invisible Nothing

hope that helps

Joe