Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi, sorry for my bad english, i have a big big problem !!
i have
| operator | login | logout |
|---|---|---|
| Alex | 09:50 | 11:30 |
| Simon | 09:00 | 10:30 |
| Luca | 11:01 | 12:00 |
i need to make a class hour for count minutes logged
| range hour | operator | minutes logged |
|---|---|---|
| 09:00 to 10:00 | Alex | 10 |
| Simon | 60 | |
| 10:00 to 11:00 | Simon | 30 |
| 11:00 to 12:00 | Luca | 59 |
usually for class 1 time i use
| =dual(timestamp(class(frac(mytime) | ,vTimeRange/(24*60)),'hh:mm') & ' - ' & | ||
| timestamp(class(frac(mytime)+vTimeRange/(24*60),vTimeRange/(24*60)),'hh:mm') | |||
| , | class(frac(mytime) | ,vTimeRange/(24*60))) |
but with range 2 times i dont know !!???
how can i do ?
there are some exaples with class two datetimes ?
thanks
I'd calculate this in the script with something like this:
Data:
LOAD *, If(Hour<login, Interval(Hour+1/24-login,'m'),if(Hour+1/24< logout,1/24,logout-Hour)) as [Minutes logged];
LOAD *, Time(Floor(login + (IterNo()-1)/24, 1/24),'hh:mm') as Hour
While Floor(login + (IterNo()-1)/24,1/24) < logout;
LOAD
operator,
Time#(login,'hh:mm') as login,
Time#(logout,'hh:mm') as logout
INLINE [
operator, login, logout
Alex, 09:50, 11:30
Simon, 09:00, 10:30
Luca, 11:01, 12:00
];
The inline load is just an example. You can replace that with a load statement that load the data from your real source table.