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: 
7UL13N
Contributor
Contributor

How to use AND or OR operators in distinct count function

Hi community,

I am rather new to Qlik Sense and I am facing difficulties in counting distinct document IDs under the condition that they are neither "n/a" nor "tbd".

I tried this:

textCount(distinct {<Doc_ID-={"n/a"},[Doc_ID]-={"tbd"}>} Doc_ID)

But as you can guess I was not successful. If I keep only one of the tests result is 29, but if I add both result becomes 30 instead of the expected 28.

 Any help welcome!

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

change it to this
textCount(distinct {<Doc_ID-={'n/a', 'tbd'}>} Doc_ID)
Channa
Specialist III
Specialist III

or

textCount(distinct {<Doc_ID-={'n/a', 'tbd'}>} Doc_ID)

 

for AND

textCount(distinct {<Doc_ID-={'n/a',} and Doc_ID-={'tbd'}>} Doc_ID)

Channa
nagaiank
Specialist III
Specialist III

Please see the following post in Qlik forum for Set Analysis operators

https://community.qlik.com/t5/QlikView-Documents/Operator-in-Set-Analysis/ta-p/1479010

Hope this helps.