Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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
Partner
Partner

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

Have you tried:

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

Jason

Not applicable

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

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])

Partner
Partner

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

What are you looking for the expression to do exactly?

Not applicable

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

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={'*'}>}

Partner
Partner

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

Ah - try this:

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

Not applicable

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

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

Partner
Partner

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

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

Not applicable

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

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

Partner
Partner

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

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])