Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Set analysis to count over multiple field values

Hi all,

I wish to use set analysis to count distinct values of a field when multiple values in another field are selected. So I created a variable vRecordType=GetFieldSelections([Record Type]), and then in the set analysis wrote this:

=count(distinct {<Market=,[Record Type]={'$(vRecordType'}>} loginname)

This works when only 1 value is selected in [Record Type] -  however it shows 0 when multiple values in [Record Type] are selected. How can I count over multiple values in this field?


1 Solution

Accepted Solutions
sifatnabil
Specialist
Specialist
Author

Nevermind. Looked through the forums and found it can be done with [Record Type]=P[Record Type]. Thanks!

View solution in original post

4 Replies
tresesco
MVP
MVP

If you want the [Record Type] field selection to be considered as it is selected, you don't have to include that in Set Analysis part, QV does it so by default. Try like:

count( {<Market=>} distinct loginname)      // this will ignore Market selection.

senpradip007
Specialist III
Specialist III

Try this:

=count(distinct {<Market=,[Record Type]={"$(=Concat(Chr(39)& [Record Type] & Chr(39), ','))"} >} loginname)

sifatnabil
Specialist
Specialist
Author

Hi tresesco, in my case the [Record Type] field is not selected, but has the associated fields in white (after I select something in Market). How can I count the non-selected associated values of [Record Type]? Thanks.

sifatnabil
Specialist
Specialist
Author

Nevermind. Looked through the forums and found it can be done with [Record Type]=P[Record Type]. Thanks!