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: 
Anonymous
Not applicable

counting when 2 or 3 conditions are not null

Following from https://community.qlik.com/message/1377067?et=watches.email.thread#1377067

where

I had a table

1.PNG

and I would like to show only rows where 2 or 3 of the columns are not null (in other words to exclude rows with 2 or more null)

so expecting to see:

1.PNG

using Sunny's solution I am Now trying to count in a Text Object how many lines are matching 2 or 3 conditions - so how many are in the solution: here for example A+D+F+I+K = 5

so I will expect to see 5 in the text Object.

Any idea,

Thanks.

Raphael

1 Solution

Accepted Solutions
sunny_talwar

May be try this

=Count(DISTINCT If(RangeSum(If(Len(Trim(Cond1)) = 0, 1), If(Len(Trim(Cond2)) = 0, 1), If(Len(Trim(Cond3)) = 0, 1)) < 2, Letter))

or this

=Count(DISTINCT {<Letter = {"=RangeSum(If(Len(Trim(Cond1)) = 0, 1), If(Len(Trim(Cond2)) = 0, 1), If(Len(Trim(Cond3)) = 0, 1)) < 2"}>} Letter)

View solution in original post

3 Replies
sunny_talwar

May be try this

=Count(DISTINCT If(RangeSum(If(Len(Trim(Cond1)) = 0, 1), If(Len(Trim(Cond2)) = 0, 1), If(Len(Trim(Cond3)) = 0, 1)) < 2, Letter))

or this

=Count(DISTINCT {<Letter = {"=RangeSum(If(Len(Trim(Cond1)) = 0, 1), If(Len(Trim(Cond2)) = 0, 1), If(Len(Trim(Cond3)) = 0, 1)) < 2"}>} Letter)

Anonymous
Not applicable
Author

Both working perfect, many thanks

sunny_talwar

I would use the second expression if both of them works