Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Count of PersonId that have Flag A and B

Hello,

I want to know the number of people that have a common A and B as Flags, each person can have multiple As and/or multiple Bs (and also he can have As without B's and vice versa). This table shows some the data:

PersonID | Flag | Field1 | Field2 | Field3

12           | A     |

12           | A     |

13           | B     |

14           | B     |

15           | A     |

15           | B     |

16           | B     |

17           | A     |

12           | B     |

12           | A     |


The result of the count should be 2 because 12 and 15 are the only personID that have records with Flag A and B.


How to obtain this?


1 Solution

Accepted Solutions
jpenuliar
Not applicable

Re: Count of PersonId that have Flag A and B

maybe this :

=count({<PersonID = p ({1<Flag = {'A'}>}) * p ({1<Flag = {'B'}>}) >}DISTINCT PersonID)

2 Replies
jpenuliar
Not applicable

Re: Count of PersonId that have Flag A and B

maybe this :

=count({<PersonID = p ({1<Flag = {'A'}>}) * p ({1<Flag = {'B'}>}) >}DISTINCT PersonID)

Not applicable

Re: Count of PersonId that have Flag A and B

Thanks! it worked