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: 
Anonymous
Not applicable

Counting with more than one condition of a data group

Good afternoon, I am trying to create a table that allows me to count the number of students who are retired from a university, here is an  example of the information I have:



     

YearIDNameProgramStatus
2006201000Luis   FlechasENIGraduate
2006201000Luis   FlechasADDRetired
2006201000Luis   FlechasCOFNormal

l

In this case the same student, for the same year, has different programs and a status for each program.


I need to count how many students were retired for one year, taking into account that if the student for that same year already has a Graduate or Normal status, he should not enter in the retired count, regardless of the program.


The student should be counted only 1 time in the cases where the status of each programa is retired. This means that is the student has 3 programas and in all of them he apears as Retired, he should count just one time.



I appreciate very much if you can help me.

regards,

3 Replies
jwjackso
Specialist III
Specialist III

I would try the e() function, https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/ChartFunctions/SetAnalysis/set-mod...

=Count({<ID=E({<Status={'Graduate','Normal'}>}),Status={'Retired'}>} Distinct ID)

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Lizette,

Could you please tell us what is your desired output.

Thanks,

Arvind Patil

Anonymous
Not applicable
Author

thank you guys, I used the following function

= Count ({$<ID= p({$<STATUS ={Retired}>}ID) - p({$<STATUS ={'Graduate','Normal'}>}ID)>} distinct ID)

it works perfect.