Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

edp
Contributor

Re: Trendline AVG Calculation

In the attached example I used a bar chart, but the average results are the same. 😞

edp
Contributor

Re: Trendline AVG Calculation

Nope if you have two dates equal themselves with two different hour values

Re: Trendline AVG Calculation

I know you are not satisfied with the average which is calculated, but that is how it is... to read more on the topic of averages, you can read here:

Average – Which average?

Highlighted
atkinsow
Valued Contributor II

Re: Trendline AVG Calculation

it's because you shouldn't really use a 'trendline'.  for that kind of dimension, you should use a reference line.

it may not be what you want it to do, but it's summing your expression total (60) and dividing by your unique dimension values.  Which if you look at the values in the chart display, that is what you're presenting.

Partner
Partner

Re: Trendline AVG Calculation

Hi Nicola,

It does what the aggr(...) formula does. It calculates the mean for Employee after summing the hours (i.e. your expression) for each Employee.

So the trendline is calculated there as (15+20+25)/3.

If your expression was avg(Hours), the trending line would be calculated as (15+10+25)/3.

Regards,

Sorin.

edp
Contributor

Re: Trendline AVG Calculation

Thank you to everybody for your explanations!

N.