Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How Aggr() handles selection with set modifier

Hi, I am trying to understand the behaviour or current selections on Aggr(). For example I have the following data set:

LOAD * INLINE [

Test, Target, SessionNum, Student

A, 10, 1, John

A, 10, 2, Mark

A, 10, 3, Mark

B, 58, 1, John

B, 58, 2, Kelly

C, 123, 1, Mark

D, 77, 1, Mark

D, 77, 2, John

D, 77, 3, John

D, 77, 4, Kelly

D, 77, 5, John

E, 947, 1, John

E, 947, 2, Kelly

F, 3, 1, Kelly

];

Then I created a straight table with the following:

Dimension: [Student]

Expression: Sum({1} Aggr(Avg([Target]), [Test]))

The result is:

John | 1015

Kelly | 3

Mark | 200

I can understand how these numbers come about. But when I select just one Student, "Mark", the result becomes this:

John | 10

Mark | 200

And I can't quite understand why this is so. Is it that QlikView will first look at what Tests that are filtered according to my Student selection (A, C, and D), and then go back to the original data set and pick only these Tests and pass them to the Aggr() function?

Thanks in advance!

10 Replies
Not applicable
Author

Thanks this is helpful. I shall explore more to try to get a better understanding.