Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vancet
Contributor II
Contributor II

Finding Averages of a Bar Chart

I have a bar chart that is showing total people served on an annual basis (Year is the Dimension, Client Count is my Measure) and then I have a second dimension stacked with the first to show the number of people served by County.  I am wanting to create a KPI for each county that will show the average number of people served in each County based on the year/years selected.  Anyone have thoughts of how to build the KPI?

Labels (4)
2 Replies
Chanty4u
MVP
MVP

Try this 

=Avg(Aggr(Sum([Client Count]), Year, County))

For specific country 

=Avg(

    Aggr(

        Sum({<County={'india'}>} [Client Count]),

        Year

   

)

)

vancet
Contributor II
Contributor II
Author

Thank you.  I'm trying the second one to make each KPI correlate to a specific county.  Here's what's I'm entering in my expression:

avg(aggr(sum({<[Client.County]={'Barber'}>}[Client Count]), Year))

 

When I exit the editor the KPI is drawing no results.  Any thoughts?