Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
guillaume_gorli
Creator II
Creator II

Average in Pivot table

Dear all,

I am using a database listing time spent by employees on different activities, each employee being defined by a status A,B or C.

Variables coming from the database are :

Date
Employee as name of the employee
Status as Status of the employee
Off as Hours spent by employee being Off
Sick as Hours spent by employee being on sick
Home Office as Hours spent by employee working from home
On site as Hours spent by employee working on site
I need to produce a pivot table with a total by status (in line) but also an average by week (in column).

What i get from the app is shown in below pic :

Capture.JPG

What i should get is the same thing except that im not looking for a Total regadring the date  but an average figure, meaning :

Capture.JPG

Attached is xlxs database as well as qvw for those who want to help.

Thanks in advance

Guillaume

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

Here you go. see attached qvw

Hope this helps

View solution in original post

5 Replies
skamath1
Creator III
Creator III

Since you have entry by date. Instead of using Sum, can you use AVG and see if it works?

Frank_Hartmann
Master II
Master II

Can you explain how you calculate the avg?
e.g.

C- Homeoffice: 2+2+2+2+6+4+6 = 24/7 <> 3
C- Working on site: 14+14+14+14+18+12+10 = 96/7 <> 12

And also the calculation of Avg Total Values (11,11,5,16) is not clear.

guillaume_gorli
Creator II
Creator II
Author

Indeed Franck, my excel formulas in the table was wrong.

Below is how the corrected average  looks like : 

Capture.JPG

 

Frank_Hartmann
Master II
Master II

Here you go. see attached qvw

Hope this helps

guillaume_gorli
Creator II
Creator II
Author

Franck, this helps a LOT !

Thanks you very much

Guillaume