Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
LocationName | LocationId | TimeIn | TimeOut | Employees | Date |
a | 100 | 8:30:00 AM | 6:30:50 PM | 100 | 11/7/2015 |
b | 200 | 9:20:30 AM | 7:20:00 PM | 345 | 11/7/2015 |
c | 300 | 8:00:00 AM | 18:30:30 | 267 | 11/7/2015 |
d | 400 | 9:00:00 AM | 7:34:00 PM | 289 | 11/7/2015 |
e | 600 | 8:45:00 AM | 7:29:00 PM | 190 | 11/7/2015 |
a | 100 | 8:30:00 AM | 6:30:50 PM | 100 | 12/7/2015 |
b | 200 | 9:20:30 AM | 7:20:00 PM | 345 | 12/7/2015 |
c | 300 | 8:00:00 AM | 18:30:30 | 267 | 12/7/2015 |
d | 400 | 9:00:00 AM | 7:34:00 PM | 289 | 12/7/2015 |
e | 600 | 8:45:00 AM | 7:29:00 PM | 190 | 12/7/2015 |
Thanks
Madhu
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
in chart
1)
count(total <LocationName> distinct Employees)
2)
add set analysis to 1
=count(Distinct [EmployeeID])
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;