Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

kidbank3
Contributor III

Set Analysis Intersection

Why does the following expression not count only ID=1:

Expression: count({<condition={'obese'}>*<condition={'DM'}>*<condition={'HTN'}>} distinct patient)

Dimension: Valuelist('HTN | DM | Obese','Obese','HTN','DM','HTN | DM','HTN | Obese','DM | Obese')

Here's my data (qvf attached):

load * inline [

condition, ID

'obese',1

'HTN', 1

'DM',1

'obese',2

'HTN',2

'obese',3

'obese',4

'obese',5

'DM',5

'DM',6

'HTN',7

'obese',8

];

1 Solution

Accepted Solutions
kidbank3
Contributor III

Re: Set Analysis Intersection

I figured out a solution.  This worked for me:

count({<ID=P({<condition={'obese'}>}ID)>*<ID=P({<condition={'HTN'}>}ID)>*<ID=P({<condition={'DM'}>}ID)>} distinct ID)

1 Reply
kidbank3
Contributor III

Re: Set Analysis Intersection

I figured out a solution.  This worked for me:

count({<ID=P({<condition={'obese'}>}ID)>*<ID=P({<condition={'HTN'}>}ID)>*<ID=P({<condition={'DM'}>}ID)>} distinct ID)