Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculate number of students based on average of scores

Dear All,

I need a help to resolve my issue.

I need to calculate number of students with a condition based on an average of marks obtained for Q6 and Q7.

For Eg:

Student       Q6   Q7    Avg

Student 1    80    90    85

Student 2    70    70    70

Student 3    90    90    90

Student 4    80    70    75

Student 5    90    70    80

Student 6    85    75    80

Student 7   100    90    95

Student 8    65    95    80

Student 9    80    70    75

Student 10  75    85    80

Result

No Of Students (Up to 80 ), No Of Students (80-90 ), No Of Students (90-100)

    7                                            3                                0

So if the average score meets the above condition then i need to count the students, i have tried this in set analysis but am not getting proper result. am getting exact average value, am struck in counting of students part.

Thanks In Advance

PFA File for Sample Data.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe along these lines:

STUDENT:

LOAD Student,

     Que,

     Marks

FROM

Student.xls

(biff, embedded labels, table is Sheet1$);

STUDENTCLASS:

LOAD *,

    if (Avg>90, '91 - 100',

        if (Avg>80,'81 - 90', 'up to 80')) as Class;

LOAD Student,

    sum(if(Que='Q6' or Que='Q7',Marks))

        /count(if(Que='Q6' or Que='Q7',Marks)) as Avg

Resident STUDENT

group by Student;

Then use the Class field to group your results (i.e. use Class as dimension and count(Student) as expression in chart object).

Hope this helps,

Stefan

View solution in original post

4 Replies
swuehl
MVP
MVP

Maybe along these lines:

STUDENT:

LOAD Student,

     Que,

     Marks

FROM

Student.xls

(biff, embedded labels, table is Sheet1$);

STUDENTCLASS:

LOAD *,

    if (Avg>90, '91 - 100',

        if (Avg>80,'81 - 90', 'up to 80')) as Class;

LOAD Student,

    sum(if(Que='Q6' or Que='Q7',Marks))

        /count(if(Que='Q6' or Que='Q7',Marks)) as Avg

Resident STUDENT

group by Student;

Then use the Class field to group your results (i.e. use Class as dimension and count(Student) as expression in chart object).

Hope this helps,

Stefan

shaik_basha
Creator III
Creator III

Hi,

  Please find the attachment of application based on student.

Regards

Not applicable
Author

Hi Stefan,

Sorry for this late reply to your response to my que. I deviated to some other work, and i got back to this and i worked based on your idea. i did few changes in the script you mentioned based on my requirement and i found solution.

Thank you very much for your great help Stefan.

Regards,

Mahendran.

Not applicable
Author

Hello Shaik,

Thanks to you too for the effort u took to solve my query. Actually i need to calculate the number of students based on the average of the marks of based on two questions. your's solution fits for whole average and selection. but i have learned things from your reply.

So, thanks to  you too...

Regards,

Mahendran