Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
malradi88
Creator II
Creator II

avg of 'sum(aggr(sum' weighted grade expression

To Whom it May Concern,

I hope this finds you well. I am currently working with a data set that includes student names and their respective grades in a variety of subjects. Calculating the average grade outcome per subject is straightforward - however when calculating cumulative average (of all subjects) weighting has to be involved as some subjects are worth more than others.

When weighting a a subject the following variables have to be taken into account: Academic Year, Subject, Grade Level. I created a table that consists of the aforementioned fields and the corresponding weight and linked it to the main learner assessment table using a composite key of Academic Year+Subect+Grade Level as Weightkey.

 

In the frontend of the app I used the following expression to get the correct weighted average per student:

sum(aggr(sum (PreScore) * Sum(Weight), learnername,Weightkey ))

While this expression works per learner it does not return a total average. Basically, I would like to average the result of the above expression but I cannot figure out the synatx..I tried putting an avg(Aggr() around it but it didn't work.

 

I have attached a sample table filtered to one learner - in the table you can see the subejcts he/she was assessed in, the actual prescore and the weighted prescore as well as the total weighted average of .548 (obtained by summing the weighted scores). As noted this works individually but I cannot seem to avg the total weighted average score across the entire dataset. 

Thank you in advance for your support and consideration. Any advice would be much appreciated!

 

Best,

 

Mohammed

 

 

 

 

Labels (4)
1 Solution

Accepted Solutions
jonvitale
Creator III
Creator III

Mohammed,

First off, good to see another person doing educational data here, good to know that there are others.

Second, are you positive you need to do this through an Aggr expression - which tends to be very slow? Why can't you weight the scores in the data model? On the front end you'll be able to average the weighted scores just like you would any other field?

View solution in original post

2 Replies
jonvitale
Creator III
Creator III

Mohammed,

First off, good to see another person doing educational data here, good to know that there are others.

Second, are you positive you need to do this through an Aggr expression - which tends to be very slow? Why can't you weight the scores in the data model? On the front end you'll be able to average the weighted scores just like you would any other field?

malradi88
Creator II
Creator II
Author

Dear Jon,

Thank you for your advice! I ended up doing it in the back-end and it works 🙂

Best,

 

Mohammed