Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Also need help on the below.
I have the LoginTime and LogoutTime need to Generate the Hours between the time in the New Column.
For Example : Taking the highlighted LoginTime and LogOut time i.e. 10:45:23 to 13:14:49 , Need to generate following hours between them i.e. 10,11,12,13 .
| LoginTime | LogOutTime |
| 10:09:08 AM | 10:18:20 |
| 10:13:54 AM | 10:34:26 |
| 10:18:46 AM | 12:19:18 |
| 10:22:06 AM | 11:06:49 |
| 10:32:54 AM | 16:15:54 |
| 10:44:11 AM | 13:12:11 |
| 10:45:23 AM | 13:14:49 |
| 10:48:58 AM | 12:37:48 |
| 10:52:21 AM | 12:39:28 |
| 10:58:15 AM | 11:03:14 |
| 10:59:52 AM | 11:24:11 |
| 10:59:57 AM | 11:49:22 |
How can I generate new column containing Hours between the LoginTime and LogOut time ?
Regards,
Alvin.
Hi,
Check with this script using while
Event:
LOAD
Hour(LoginTime) AS HourLogin,
Hour(LogOutTime) AS HourLogout,
Hour(LoginTime) + IterNo() - 1 AS Hours,
LoginTime,
LogOutTime
While (Hour(LoginTime) + IterNo() - 1) <= Hour(LogOutTime) ;
LOAD * INLINE [
LoginTime, LogOutTime
10:09:08 AM, 10:18:20
10:13:54 AM, 10:34:26
10:18:46 AM, 12:19:18
10:22:06 AM, 11:06:49
10:32:54 AM, 16:15:54
10:44:11 AM, 13:12:11
10:45:23 AM, 13:14:49
10:48:58 AM, 12:37:48
10:52:21 AM, 12:39:28
10:58:15 AM, 11:03:14
10:59:52 AM, 11:24:11
10:59:57 AM, 11:49:22
];
Hope it helps
Celambarasan
Check the attached qlikview file
Hope it helps
Celambarasan
Yes, there rows duplicated in my example.
Your example is nice, small and functional.