Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Average for category

I have created the first 3 columns in the below straight table. This shows the '% Logged' by 'Category' and 'Week Ending'

The '% Logged' is calculated with the following expression.

=sum({$<[Category]=>} Count1)
/
count({$<[Category]=>} total<[Calendar.Date Week End]> [Call Start])

I now want to create a 4th column (as shown) which provides and average '% Logged' for each 'Category'

I've tried the below expression (and others!) but haven't been able to achieve the desired result... Can anyone help with the correct expression for this??

=aggr(
sum({$<[Category]=>} Count1)
/
sum({$<[Category]=>} total<[Calendar.Date Week End]> Count1)
,
[Category])

 

CategoryWeek Ending % Logged Average
TestA22/02/20152.06%2.77%
TestA01/03/20152.30%
TestA08/03/20152.52%
TestA15/03/20152.68%
TestA22/03/20152.37%
TestA29/03/20152.89%
TestA05/04/20153.86%
TestA12/04/20153.49%
TestB22/02/20152.36%3.12%
TestB01/03/20153.35%
TestB08/03/20153.10%
TestB15/03/20153.18%
TestB22/03/20152.87%
TestB29/03/20153.34%
TestB05/04/20153.02%
TestB12/04/20153.76%
TestC22/02/20152.41%2.46%
TestC01/03/20152.24%
TestC08/03/20152.78%
TestC15/03/20152.63%
TestC22/03/20152.33%
TestC29/03/20152.38%
TestC05/04/20152.30%
TestC12/04/20152.58%

Thanks

5 Replies
sunny_talwar

Try this maybe:

=Avg(Aggr(Sum({$<[Category]=>} Count1) /
                 Sum({$<[Category]=>} total<[Calendar.Date Week End]> Count1), [Category]
))

giakoum
Partner - Master II
Partner - Master II

a sample app would help

Not applicable
Author

Thanks for looking sunindia, your expression returns values but they're unfortunately incorrect.

sunny_talwar

What values is it returning? Would you be able to share a sample?

Best,

Sunny

Not applicable
Author

sample now attached.

Thanks