CDickson
CDickson

Reputation: 195

Qlikview - Count IF A = X AND B != Y OR Z

As the title says, I'm trying to get a count of data that follows the logic above. What I have so far;

=COUNT(IF(A='X', A AND IF(B <> 'Y' OR B <> 'Z', B)))

I'm aware I could do a set analysis, but A) doing so makes it so that selecting a different value of A still shows all data where A = X and B) I want to figure this out.

Upvotes: 0

Views: 7759

Answers (1)

fchukoskie
fchukoskie

Reputation: 346

First, I'd encourage using set analysis. If you're going this route, however, I think that it's easier to read if you switch to using the Sum function:

Sum(If(A='X' AND (B <> 'Y' OR B <> 'Z'), 1, 0))

Upvotes: 1

Related Questions