Skip to main content
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
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Have you tried:

sum({$<Institution={'*'}>} aggr([Actual value]*[Number of Respondents],[Question number],[Institution],[Subject],[Level])) / sum([Number of Respondents])

Jason

Not applicable
Author

Hi Jason,

I tried this but it give me the same result as :

sum(aggr([Actual value]*[Number of Respondents],[Question number],[Institution],[Subject],[Level]))/

sum([Number of Respondents])

Jason_Michaelides
Luminary Alumni
Luminary Alumni

What are you looking for the expression to do exactly?

Not applicable
Author

So the first expression works out the Average, for what ever is selected in the app.

Then with the second expression, I want to give an Average for all Institutions, regardless of which one is selected.

ie. {$<Institution={'*'}>}

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Ah - try this:

sum({$<Institution= >} aggr([Actual value]*[Number of Respondents],[Question number],[Institution],[Subject],[Level])) / sum([Number of Respondents])

Not applicable
Author

It's really odd, because both expressions give the same values.

I'm going to attach the sample I'm working on to the original post

Jason_Michaelides
Luminary Alumni
Luminary Alumni

You may need to remove "Institution" from the Aggr() function.

Not applicable
Author

I also tried that, but strangely it still gives the same values for both expressions..

Jason_Michaelides
Luminary Alumni
Luminary Alumni

I just had another look and think you need to add the set analysis into the second half of the equation too (although the number gets very small then!):

sum({$<Institution= >} aggr([Actual value]*[Number of Respondents],[Question number],[Institution],[Subject],[Level])) / sum({$<Institution= >} [Number of Respondents])