Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Taking Average after COUNT

HI,

I have to count ACTIVITY and then take its average. I am using this code

=Avg(Count(ACTIVITY)) but its not working.

Can Anyone help me with this.

With Regards,

Vikas

1 Solution

Accepted Solutions
Not applicable
Author

See attached... Hope it helps

View solution in original post

6 Replies
Not applicable
Author

Could you give a bit more details? An example qvw or a situation (with some data in a table) where we can see what you want? Average per....? year, week, month or per car, or per person? per ehhh??

Lets say it is activity per person and your table is like this

- person 1 day 1 activity 3 hours

- person 1 day 1 activity 5 hours

- person 2 day 1 activity 3 hours

and you'd like to have the average hours per person, then a chart with

- dimension person and

- expression  like sum(activity) / count(person)

would give you the average activity per person

Does this help?

Avg(count(activity)) won't work as count(activity) just returns 2 and 1 in my example (per person) the average of that count would result in the same values too...

Not applicable
Author

No I have Activity like

ACTIVTY

1)CREATED

2)OPEN

3)VIEWED

I have to find out how many activity is done per month.

Which I can find by COUNT(ACTIVITY), but I have to also find AVERAGRE Activity per month...

How can I do this?

Not applicable
Author

See attached... Hope it helps

Not applicable
Author

Thanks It worked..

nagaiank
Specialist III
Specialist III

You can use the following expression also:

Avg(Aggr(Count(activity),activityYearMonth))

becky3832
Contributor
Contributor

Hi - I am not able to download the attachment. 

I am trying to complete the same function.  average(count(function)).  I'm getting the error:

"Nested aggregation not allowed"

Thank you!