Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hjm35055
Partner - Contributor III
Partner - Contributor III

Set Analysis Help

Hi,

I have data that looks like below.  In a text box, I am trying to create an expression that shows the number of 100% VALID entities.  So with the example below, my answer would be 1.  I originally was doing =Count(DISTINCT {<[Validity Check] = {'Valid'}>} [Entity ID]. However this does not work because it is counting entity 1 and 2.  I loaded [Validity Check] as a dual Valid,0 and Invalid,1 in the script thinking I could do some set analysis that says count distinct entity ID where the sum([Validity Check] = 0. But could not figure out how to get that expression working.  Any help is appreciated. Thanks!

Screen Shot 2018-02-01 at 6.53.36 AM.png

1 Solution

Accepted Solutions
sunny_talwar

May be try this

=Count(DISTINCT {<[Entity ID] = e({<[Validity Check] -= {'Valid'}>})>} [Entity ID]

or this if Validity Check can only ever be Valid or Invalid

=Count(DISTINCT {<[Entity ID] = e({<[Validity Check] = {'Invalid'}>})>} [Entity ID]

View solution in original post

1 Reply
sunny_talwar

May be try this

=Count(DISTINCT {<[Entity ID] = e({<[Validity Check] -= {'Valid'}>})>} [Entity ID]

or this if Validity Check can only ever be Valid or Invalid

=Count(DISTINCT {<[Entity ID] = e({<[Validity Check] = {'Invalid'}>})>} [Entity ID]