Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Find total hours Spent?

Hello Friends if i ma having to coloumns checked in and checked out.
Example:

Checked in
Checked out
2/12/2013 8.302/12/2013 11.55
2/12/2013 12.462/12/2013 17.55
3/12/2013 8.303/12/2013 11.30
3/12/2013 11.453/12/2013 19.00

Now from thses coloumns i want total hours spent for that particular project.

first coloumn present is the project name and then checked in and checked out time .

8 Replies
Not applicable
Author

are you looking for the differences between 2 dates in hours? do you need to count only business days? How many hours a day? Please, would you add the expected result for each row?

senpradip007
Specialist III
Specialist III

You can use

(Timestamp#([Checked out],'DD/MM/YYYY hh.mm') - Timestamp#([Checked in],'DD/MM/YYYY hh.mm'), 'hh') AS SpentTime

Not applicable
Author

Actually the columns are like as follows:

Project Name    Checked in                   Checked Out

   A                  2/12/2013 8.30            2/12/2013 11.55

   A                  2/12/2013  12.46         2/12/2013  17.55

  B                    3/12/2013 8.30           3/12/2013  11.30

C                     3/12/2013 11.45          3/12/2013   19.00

Now i want to find out total hours spent for each project.

Like now for A toal 8.64 hours spent

tresesco
MVP
MVP

Use interval(), like:

Interval(date1-date2, 'hh') as HourDiff

Not applicable
Author

This function works on your dataset... but if your the difference betwwen In and Out is more than 1 day, your team will works 24/7

//the team works 24h/7d

Interval(date#(Out,'D/MM/YYYY h.mm')- date#(In,'D/MM/YYYY h.mm'),'h')   as Delta,

//the team works 8h 7d/w.

Interval((date#(Out,'D/MM/YYYY h.mm')- date#(In,'D/MM/YYYY h.mm'))/3,'h')   as DeltaWorkHours

Anonymous
Not applicable
Author


hi

check this

Regards,

Ravi N.

Not applicable
Author

Hi vijay,

time(Timestamp#(Outtime,'DD/MM/YYYY hh.mm') - Timestamp#(Intime,'DD/MM/YYYY hh.mm'), 'hh.mm') AS difference

and group by project name

jagan
Luminary Alumni
Luminary Alumni

Hi Vijay,

Try like this in script

LOAD

*

Interval([Checked Out]-[Checked in], 'hh') as HourDiff

FROM DataSource;

Now in Chart use

Dimension : Project Name

Expression : Sum(HourDiff)

Hope this helps you.

Regards,

Jagan.