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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count with set expression?

Hello,

I've got the following data:

student/grade

a =2

a=3

b=0

c=3

I'd like to calculate the average grade among the student with significant values:

(2+3+3)/2=4

How can I express this formula with something like as: Sum(value)/count (DISTINCT student)?

Thks.

N.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

SUM(Grade)/Count(Distinct Student)

or

SUM(Grade)/Count({<Student = {"=SUM(Grade)>0"}>}Distinct Student)

View solution in original post

2 Replies
MK_QSL
MVP
MVP

SUM(Grade)/Count(Distinct Student)

or

SUM(Grade)/Count({<Student = {"=SUM(Grade)>0"}>}Distinct Student)

Anonymous
Not applicable
Author

The first one is what i've written, but it's wrong because it counts also B student, who is without grade; contrariwise the second one is perfect...just what I need.

Thank you very much.

N.