Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Mauritz_SA
Contributor III

Average of the excluded values

Hi everyone

This might be a simple question, but I can't seem to wrap my head around it. I have a table which can be simplified to the one below:

ClassGroupScore
A110
A220
A350
B480
B585
B640

 

I want the average score for my selections which I can get by using a simple Avg(Score). When I select Class = A and Group = 2 then my Avg(Score) will give me 20. How can I get the average for the scores in my selected Class (A), but for the Groups which are not in my Group selection (1 and 3). In other words, when I select the class and group in green in the table below, I want to get the average of the blue values (=(10+50)/2=30).

ClassGroupScore
A110
A220
A350
B480
B585
B640

 

Please let me know if anything is unclear.

Regards,

Mauritz

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Average of the excluded values

hi 

this expressions will do the trick 

Avg({<Group=e(Group)>}Score)

what it does , it disregards the selection in the group field and instead use the excluded values from the field 

2 Replies
Highlighted
Partner
Partner

Re: Average of the excluded values

hi 

this expressions will do the trick 

Avg({<Group=e(Group)>}Score)

what it does , it disregards the selection in the group field and instead use the excluded values from the field 

Mauritz_SA
Contributor III

Re: Average of the excluded values

Hi @lironbaram 

Thanks, works like a charm.

Regards,

Mauritz