Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

Counting number of Employees

Hi Experts

Please Help to me to write the Script as per the following requirements ,

i) How we can calculate number of employees at each LocationName

ii) How we can count "Count of distinct employee that punched during a given Time period " , in script level

     

      

LocationNameLocationIdTimeInTimeOutEmployeesDate
a1008:30:00 AM6:30:50 PM10011/7/2015
b2009:20:30 AM7:20:00 PM34511/7/2015
c3008:00:00 AM18:30:3026711/7/2015
d4009:00:00 AM7:34:00 PM28911/7/2015
e6008:45:00 AM7:29:00 PM19011/7/2015
a1008:30:00 AM6:30:50 PM10012/7/2015
b2009:20:30 AM7:20:00 PM34512/7/2015
c3008:00:00 AM18:30:3026712/7/2015
d4009:00:00 AM7:34:00 PM28912/7/2015
e6008:45:00 AM7:29:00 PM190

12/7/2015

Thanks

Madhu

4 Replies
Not applicable

If you perform Count (distinct employees), you will get a count of the number of the different employees.  If you have a dimension for timein, timeout, when you make those selections, the count will reflect the distinct employee ids that punched in during a specific time period.  If you use a pivot table with a dimesnion for location, the count would then repreent the count by location

maxgro
MVP
MVP

in chart

1)

count(total <LocationName> distinct Employees)

2)

add set analysis to 1

Not applicable

=count(Distinct [EmployeeID])

effinty2112
Master
Master

Hi madhu,

Try this:

Data:

Load

*,

TimeIn & ' - ' & TimeOut as Shift;

LOAD LocationName,

     LocationId,

     TimeIn,

    

     Alt(time(time#(TimeOut, 'hh:mm:ss TT')),time(time#(TimeOut, 'hh:mm:ss'))) as TimeOut, //standardises the time format

    

     Employees,

     Date

FROM

[https://community.qlik.com/thread/194384]

(html, codepage is 1252, embedded labels, table is @1);

EmployeesByLocation:

LOAD

LocationId,

Sum(Employees) as NumEmployeesByLocation

Resident Data

Group by LocationId;

EmployeesByShift: //disregards the day

LOAD

Shift,

Sum(Employees) as NumEmployeesByShift

Resident Data

Group by Shift;