Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Emp_id | E_date | E_Hours |
1 | 1/1/2001 | 3:00:00 AM |
1 | 1/1/2001 | 3:00:00 AM |
1 | 1/2/2001 | 6:00:00 AM |
1 | 1/3/2001 | 4:00:00 AM |
1 | 1/4/2001 | 7:00:00 AM |
1 | 1/5/2001 | 8:00:00 AM |
2 | 1/1/2001 | 9:00:00 AM |
2 | 1/2/2001 | 10:00:00 AM |
2 | 1/3/2001 | 11:00:00 AM |
how to calculate the hours based on emp id and date
Is E_hours a time or a number of hours? What kind of information is stored in E_hours?
Perhaps sum(E_Hours) gives you the result you're looking for.
e_hours contains hours
We need more inputs to help you, Such as what does E_hours mean? is it a login time where to want to calculate the no of hours of the Emp based on Diff btw time? or is it just no of hr?
Then sum(E_Hours) should give you the result you need. Perhaps you need to format it with the Interval function:
Interval(Sum(E_Hours),'hh:mm:ss')
TABLE1:
LOAD Emp_id,
E_date,
E_Hours,
Billed_status
FROM
[..\Rm poc_Qlikview\Emp_count.xlsx]
(ooxml, embedded labels, table is Sheet7);
table2:
load Emp_id,
E_date, sum(E_Hours) as Worked_hours Resident TABLE1 Group by Emp_id,E_date;
table3:
LOAD Emp_id,
E_date,if(Worked_hours<4,'Available',
if(Worked_hours <8 and Worked_hours>=4,'Partially Occupied',
if(Worked_hours>=8,'Fully Occupied'))) as Allocation resident table2;
i got the answer but now i want to Billed_status = 'yes' which employee have to display,
but here billed_status containd table 1 and worked hours contains table 2 both are conflict . how to overcome and take worked_hours based on billed status?
Maybe try
table2:
load Emp_id,
E_date, sum(E_Hours) as Worked_hours Resident TABLE1
where match(Billed_status, 'yes')
Group by Emp_id,E_date;
on step 2
its just a no.of hour only