Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Not applicable

Conditional count with OR

What is the correct syntax to count instances of two filters using an OR?

Basically I need to count:

Count ( {<BLOB={'>0'}>} DISTINCT DeviceID ) + Count ( {<FOO={'>0'}>} DISTINCT DeviceID ), but then their might be repeated DeviceID's for devices that have both BLOB and FOO.

So, looking for something like this:

Count ( {<BLOB={'>0'} or FOO={'>0'} >} DISTINCT DeviceID )

Count ( {<BLOB={'>0'} || FOO={'>0'} >} DISTINCT DeviceID )

Tags (1)
1 Solution

Accepted Solutions

Re: Conditional count with OR

Count ({<BLOB={'>0'}>+<FOO={'>0'}>} DISTINCT DeviceID )

From QV Help:

Set Operators

Several set operators that can be used in set expressions exist. All set operators use sets as operands, as described above, and return a set as result.

+ Union. This binary operation returns a set consisting of the records that belong to any of the two set operands.

- Exclusion. This binary operation returns a set of the records that belong to the first but not the other of the two set operands. Also, when used as a unary operator, it returns the complement set.

* Intersection. This binary operation returns a set consisting of the records that belong to both of the two set operands.

/ Symmetric difference (XOR). This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.

2 Replies
Not applicable

Re: Conditional count with OR

Hi Jessica,

try this:

Count ( {<BLOB={'>0'} + FOO={'>0'}>} DISTINCT DeviceID )


best regards

Re: Conditional count with OR

Count ({<BLOB={'>0'}>+<FOO={'>0'}>} DISTINCT DeviceID )

From QV Help:

Set Operators

Several set operators that can be used in set expressions exist. All set operators use sets as operands, as described above, and return a set as result.

+ Union. This binary operation returns a set consisting of the records that belong to any of the two set operands.

- Exclusion. This binary operation returns a set of the records that belong to the first but not the other of the two set operands. Also, when used as a unary operator, it returns the complement set.

* Intersection. This binary operation returns a set consisting of the records that belong to both of the two set operands.

/ Symmetric difference (XOR). This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.