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

How to get this set analysis into aggr expression(nested)

Hi,

I have the expression

sum(aggr([Actual value]*[Number of Respondents],[Question number],[Institution],[Subject],[Level])) / sum([Number of Respondents]) which works, but I now need to incorporate this simple set analysis into it : {$<Institution={'*'}>}

I'm unsure of which order it needs to be in and seem to be going around in circles.

Any ideas on how it can be changed to bring the two expressions into one.?

Thank-you!

25 Replies
Not applicable
Author

Not much luck.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

To be honest I was guessing!  Challenging one - I don't use Aggr() much.

Not applicable
Author

I'll carry on at it. It appears so simple though..hmmm.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

I'm looking at it and wondering if the problem isn't in the data model.  What does "Number of respondents" mean? Should it be in the Fact table with Question number?  Or is it a number of respondents per question?  Can you give a little background on the data.

(I'm hooked on this now...)

Not applicable
Author

It's basically student data with the Question Number being a key in the fact table, along with:

Institution, Subject, Level, [Question number], [Number of Respondents] and [Actual value] etc. etc.

The Global Average used to just be the simple expression : //AVG({$<Institution={'*'}>}[Actual value]), which needed to be changed, as it wasn't giving the correct values.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

So does this record mean that 19 "Other undergraduates" studying Business Studies in the selected institution answered 63% for Q18?

22-09-2011 18-01-58.png

Not applicable
Author

Yes, that's exactly what it's saying.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Sorry, just to be clear - did 19 students get Q18 63% correct or was the answer given by 19 students '63%'?

Not applicable
Author

Hi Jason,

Apologies for not being clear.

So, it's saying that Q18 was answered(given) by 19 students.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

And 63% of those 19 students got it right?