Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get the Average of a Set

Hi All,

From a set of raw data I am creating a sum of Amount, grouped by Partner and Type in a pivot table. 

I need to get the average of those sum values but in a separate table and grouped by a new dimension, Band and then Type as before.

So I am creating a set as below -

=sum          ({$<Type>}                     (aggr ({$<Type>}Amount), Partner))

What I can't work out is how to find the average of that set of values.

I hope that makes sense.

Thanks

Lee

1 Solution

Accepted Solutions
swuehl
MVP
MVP

In summary table, I think you'll get the totals of POC in each line using

=Sum({<Legitimate ={1}>} total<Type>  Amount)

so the average could be

=Sum({<Legitimate ={1}>} total<Type>  Amount) /count(DISTINCT Partner)

Is this what you are looking for?

View solution in original post

4 Replies
swuehl
MVP
MVP

Lee,

could you post some lines of sample data, maybe with an Inline table together with your expected results? Or a small sample app?

In your above expression, I am not sure what you want to achieve with {$<Type>} ? Maybe you want to use the total qualifier with dimensions, like total<Type> ?

Again, I think I have not fully understood your requirements, so some sample data and expected results would really help me.

Regards,

Stefan

Not applicable
Author

Hi,

I have uploaded a sample of the document.  On the front page you will see a table called Scorecard POC.

Above that is another table called summary.  The summary table needs to total the Scorecard column values and average it over the Scorecard data.

If you average it over the raw data, the number is not as required.  So what I was trying to do was create a dataset mirroring the Scorecard values by type and avg them out over the distinct partner count.

Hope that helps.

Lee

swuehl
MVP
MVP

In summary table, I think you'll get the totals of POC in each line using

=Sum({<Legitimate ={1}>} total<Type>  Amount)

so the average could be

=Sum({<Legitimate ={1}>} total<Type>  Amount) /count(DISTINCT Partner)

Is this what you are looking for?

Not applicable
Author

Thank you so much, that is perfect