Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mmaidana
New Contributor

3 year average

Hi,

I have a combo chart which I would like to show years and average of sales over those years as a line across the bars.  I have tried a reference line as well as some calculations but can not seem to get the correct answer.  It only reports on the average for that particular year and not all years. Can anyone help please?

Thank you

4 Replies
MVP
MVP

Re: 3 year average

Try something like

=Avg( TOTAL SalesField)

or

=Sum(TOTAL SalesField) / Count(DISTINCT TOTAL YearField)

mmaidana
New Contributor

Re: 3 year average

Hi

Thanks for your reply. These were what I had initially tried these but it only gives me average for that one year not a 3 year average.

phaneendra_kunc
Valued Contributor III

Re: 3 year average

Your requirement doesn't make any sense to me unless i am missing something here.

You have a combo chart, assuming Year as a dimension and couple of metrics, 1.sum?? 2. Average.

So sum is a bar? and plots a bar for every year and an average as a line and you want to plot 3 year average. This is where i am getting confused. so if you do average you will one value for each year. Or if you manage to aggregate then you will get one value. not sure how you are ogign to trend this.

Do you have any other dimension beside Year in you chart? Perhaps a sample app would be good to see.

MVP
MVP

Re: 3 year average

Monica,

the TOTAL qualifier should disregard your (assumed) year dimension), hence calculate average across all years.

The Aggregation Scope

Community Browser