Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
FernandaNava
Partner - Contributor III
Partner - Contributor III

Count distinct and set analysis

Hello,

 

I'm trying to count the distinct ID's for a field that have a flag=1. I have tried:

count(DISTINCT {<flagmanual={'1'}>} studyuid)

 

and solutions posted for these questions:

https://community.qlik.com/t5/QlikView-App-Development/Count-distinct-in-Set-Analysis/td-p/602254

https://community.qlik.com/t5/QlikView-App-Development/Count-distinct-in-Set-Analysis/td-p/602254z

 

But I can't seem to get it to work. I tried using '1' to not have my measure affected by selections but the result doesn't change.

 

I appreciate your help

Labels (2)
5 Replies
Lisa_P
Employee
Employee

is the data related ?
lironbaram
Partner - Master III
Partner - Master III

hi 

one thing , you can try to write the 

count(DISTINCT {<flagmanual={1}>} studyuid)

but to really help you , can you describe if both fields are in the same table , or connected somehow

FernandaNava
Partner - Contributor III
Partner - Contributor III
Author

They are fields in the same table. If pick my flag from a selection pane the data is in fact affected. I even tried inserting the set expression from current selection via the wizard but it's still not working. 

nicu1996
Contributor III
Contributor III

$ is the default state.

1 is the alternate state.

 

Try:

COUNT(DISTINCT {1<flagmanual={'1'}>} studyuid)

 

Sameer9585
Creator II
Creator II

try this?

count({<flagmanual={1}>} distinct studyuid)