Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem: Total number in a selection

I'm developing a QV document that, among other things, are going to calculate average absence data for a number of schools per Term.

I have to divide the number of days absent (column C)  on the number of students in the current selection (column A). However, I can't just divide the data for absence code GFE on the number of students with the absence code GFE, I have to divide it on the total number of students in the current selection in the school. That is, for school X I have to divide the different numbers in column C on the total 1, and for school Y I have to divide the numbers on total 68.

I can't divide on the number of students at the school, because not everyone is registered at each term. I have to have an expression that divides on the total number of students in the current selection at each school. Ie 505 for School X, and 68 for school Y.

Expression for Number of days absent: sum(Sessions)

Expression for Average: (Sum(Sessions))/count(total{$}PersonCounter)

Expression for number of students: sum(PersonCounter)

Expression for number of students at the school: sum(OrgPersonCount)

To clarify: I need an expression that will calculate the GFE for School X to be 0,97 (488 number of days absent/505 total number of students in the selection for school X).

Any suggestions?

Message was edited by: Joachim Hollekim

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this as expression for the average: Sum(Sessions)/sum(total <OrganisationTitle> PersonCounter)


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
rustyfishbones
Master II
Master II

could you share part of the Application?

swuehl
MVP
MVP

Not sure if I fully understood, a sample application with your expected results may help.

You can look into using TOTAL with a field list, like

=count(TOTAL<Organization> PersonCounter)

Not applicable
Author

What do you need?

Not applicable
Author

Sorry, that did not work. Capture.JPG.jpg

rustyfishbones
Master II
Master II

the qvw you are working on, or a reduced data version of it

Not applicable
Author

Ah, I see. I have attached an example to my original post.

Gysbert_Wassenaar

Try this as expression for the average: Sum(Sessions)/sum(total <OrganisationTitle> PersonCounter)


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

You need to use the correct field name for your dimension Organization:

=count(total<[OrganisationTitle]>  PersonCounter)

Not applicable
Author

That did it! Thank you very much!