Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

r_vdbraak
New Contributor III

Add average to graph

Hi,

In my line graph I have the dimensions WeekYear and Company

I have one expression that is a calculated result.

I want to add the average results of all companys to the graph.

How can I do this.

Thanks,

Richard

Tags (3)
1 Solution

Accepted Solutions
rajat2392
Contributor III

Re: Add average to graph

=count({$<Resultaat={'Gepakt'}>}Resultaat)/count({$<Resultaat={'Gepakt', 'Gemist'}>}Resultaat)

with this you are limiting your result to one company only...you have dimension as company...so just write this expression

=count(Resultaat)/count(TOTAL Resultaat)

so when the dimension will be Company, for each Company it will give the average of each Company...when the dimension is Week or Year, the average will be for each Week or Year respectively.

9 Replies
sujeetsingh
Honored Contributor III

Re: Add average to graph

Just use as

sum({1}Field1)/count({1}Field1)

sujeetsingh
Honored Contributor III

Re: Add average to graph

This will give you the overall Avg of the data

Not applicable

Re: Add average to graph

Hi Richard,

you could add the average from the Graph Properties->Expression-> Trendlines-> click on Average.

I hope this help you.

average.png

r_vdbraak
New Contributor III

Re: Add average to graph

Sujeetsingh,

Thanks for thinking with me.

When I try your answer my own results are not shown.

I use the expression:

=count({$<Resultaat={'Gepakt'}>}Resultaat)/count({$<Resultaat={'Gepakt', 'Gemist'}>}Resultaat)

Gr. Richard

thornofcrowns
Valued Contributor II

Re: Add average to graph

Sometimes the simple answer is the best.

r_vdbraak
New Contributor III

Re: Add average to graph

Guiseppe,

Thanks for thinking with me.

When I use this solution I got a straight line for every Company.

What I want is one line for all Companies together that shows the average result per week.

Gr. Richard

r_vdbraak
New Contributor III

Re: Add average to graph

When it does what you want, Yes.

rajat2392
Contributor III

Re: Add average to graph

=count({$<Resultaat={'Gepakt'}>}Resultaat)/count({$<Resultaat={'Gepakt', 'Gemist'}>}Resultaat)

with this you are limiting your result to one company only...you have dimension as company...so just write this expression

=count(Resultaat)/count(TOTAL Resultaat)

so when the dimension will be Company, for each Company it will give the average of each Company...when the dimension is Week or Year, the average will be for each Week or Year respectively.

arjunkrishnan
Contributor

Re: Add average to graph

Hai frd..

Calculate Your Avg In Reference line in Chart...

Presentation Tab->Reference line -> Substitute Ur Formula In Expression and Lable -> U Should Show The Avg In Line In Your Chart....

Community Browser