Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I have the below dataset:
Student ID, Semester
1, A
2, A
2, B
3, B
I am using the below expression to give me the count of the common items which should be 1 since only student 2 attened semester A & B. But it is giving me 4. Can someone help please?
=Count(
{1<Semester=,[Academic Year]=,SemesterNO={'$(=max(SemesterNO))'}> +
1<Semester=,[Academic Year]=,SemesterNO={'$(=max(SemesterNO)+100)'}>}
DISTINCT Enrolment.EMPLID)
To get the value:
=Only({<[Student ID]=p({<Semester={'A'}>})*p({<Semester={'B'}>})>}[Student ID])
To get the count:
=Count(DISTINCT {<[Student ID]=p({<Semester={'A'}>})*p({<Semester={'B'}>})>}[Student ID])
You seem to be using the '+' operator, which is union, rather than the '*' modifier for intersect.
can you share a sample data
SemesterNO ? Academic Year ? Semester ?
what is the expected output ? from this output :
Student ID, Semester
1, A
2, A
2, B
3, B
To get the value:
=Only({<[Student ID]=p({<Semester={'A'}>})*p({<Semester={'B'}>})>}[Student ID])
To get the count:
=Count(DISTINCT {<[Student ID]=p({<Semester={'A'}>})*p({<Semester={'B'}>})>}[Student ID])
One more solution.
=Count(DISTINCT{<[Student ID]={"=Concat(DISTINCT Semester)='AB'"}>}[Student ID])
Thanks to all who responded and provided solutions :). Really appreciate the amazing qlik community.