Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help in expression

Hi All,

I have the following 3 fields I need the count of Student Id's who have completed the course


CourseID         StudentId  Marks
    100                 1               95
     101                2               65  
     101                1               35
     100                2
     102                1               36   

I want to see how many have completed each course ? Completed means who has marks

expected o/p should be based on the course Id
CourseId  Completed Count
100            1

101            2

102            1 

PS:

Tried the following expression,it didnt work out

=count({$ <course_id={00100},score-={''}>}(ID)) (For a single course)

Is there any other way apart from Set Analysis as an work around? Do let me know

Thanks in advance

4 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Try this expression

Count( If(alt(Marks), StudentId))

Regards,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
jerem1234
Specialist II
Specialist II

Try a straight chart with CourseID as dimension and this expression:

count({<Marks-={''}>}StudentID)

Gave me same output as you have listed.

Hope this helps!

salto
Specialist II
Specialist II

Hi,

try this expression in a chart with the CourseID as a dimension:

=count( { < Marks -={''}>} Student)

It will give you a yntax error, but it is QV bug. It works for me.

HTH.

Anonymous
Not applicable
Author

Hi,

     You can try with script like this:

set NullInterpret ='';

TAB1:

LOAD * Inline

[CourseID, StudentId, Marks

100, 1, 95

101, 2, 65

101, 1, 35

100, 2,

102, 1, 36];

TAB2:

LOAD

    CourseID,

    StudentId,

    Marks,

    If(IsNull(Marks), 0, 1) as Bit

Resident

    TAB1;

  

TAB3:  

LOAD CourseID,

    Sum(Bit) as Count,

    Count(StudentId) as C

Resident

    TAB2  

Group By

    CourseID;

  

DROP Tables TAB1, TAB2; 

Hope this will work for you.

Regards,

Harshal Gawande