# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Don't miss the upcoming Q&A with Qlik session on Qlik Application Automation on November 16th! REGISTER NOW
cancel
Showing results for
Did you mean:
Creator III

## how to find average sales of last three years(2010,2011,2012)

i tried .....

sum({<Year={2010,2011,2012}>}Sales)

/

Count({<Year={2010,2011,2012}>}Sales)

is there any other way to find averag

6 Replies
MVP

I think average can be very tricky and you might want to look here for why....

You can do this

Avg({<Year={2010,2011,2012}>}Sales)

Or this

Sum({<Year={2010,2011,2012}>}Sales)

/

Count(DISTINCT {<Year={2010,2011,2012}>} Trans_ID)

Creator III
Author

Hi,

I am getting different answer by both ways:-

but naswer should be the same

;-

NOte:- Dimension------Year(2009,2010,2011,2012)

Measure:--------Sales(Sum)

MVP

Like I mentioned.... Average can be tricky... do you or your users agree with one of the two ways the average is getting calculated?

Luminary Alumni

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others

Specialist

Sum({<Year={2010,2011,2012}>}Sales)/Count(DISTINCT{<Year={2010,2011,2012}>}Year)

Creator III
Author

Today I tried to formula ,I got same output for both for finding average of last three years(2010,2011,2012)

In my graph ,

Dimension- year(2010,2011,2012)

Measure  ----Sum(Sales)

Here I have attached two  screen shots ..in which by both ways I got same output for the average sales of last three years

Expressions:-

Avg({<Year={2010,2011,2012}>}Sales)

or

Sum({<Year={2010,2011,2012}>}Sales) / Count( {<Year={2010,2011,2012}>} Sales)

Tags
Community Browser