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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Average days/employee

Hi

I've just started to work with QW, and I have a problem. Would be really grateful if someone can help me or point in the right direction.

Simplified data from two tables

Table 1




EIDUnitSectionGroup

Employee


NN1AAAAAA1
NN2AAAAAA1
NN3BBBBBB1
NN4BBBBBB1
NN5BBBBBB1
NN6CCCCCC1
NN7CCCCCC1






Table 2




EIDUnitSectionGroupAbsenceNo Days
NN1AAAAAASick leave6
NN2AAAAAAVacation3
NN3BBBBBBVacation5
NN4BBBBBBSick leave5
NN7CCCCCCSick leave2






Outcome in table 3











Table3




UnitNo DaysAvg days/emp


A94,5


B103,3


C22

(Unit is a hierarchy group)

Avg/emp i based och sum(no days)/sum(employee). If I want to se avg days/emp för sick leave only, what do I do to keep the total number of employees, i.e not only emplyees on sick leave?

//Daniel

4 Replies
Not applicable
Author

Set Analysis,

sum({$<Absence={[Sick leave]}>}no days)/sum(employee)

Not applicable
Author

Thanks for your help. That worked for a fixed table.

I think I need to be a bit more specific. I've got Absence in a Listbox and choose sick leave, then sum(employee) only counts EIDs that have been on sick leave. I need avg/emp to always be based on total number of employees regardless of the type of absence.

(I also need to be able to show avg/emp if I filter by section or group in hierarchy)

Not applicable
Author

not sure about syntax but try sum(all employee).

Not applicable
Author

Sum (all employee) gives the total sum for all units which means every unit gets the same total of employees.

I seems to me that I need to give every unit, section and group a "fixed" numer of employees so it doesnt reflect choises made in other listboxes. How do I do that?

Thanks for your effort anyway.