Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

time

Hello Guys,

I have a field in seconds. I would like to convert it into time (minutes / hours). I used this formula : Time(Time#(fabs(TIME), 'ss'), 'h:mm')

but the result is wrong

Capture.PNG

any help please?

Thanks

9 Replies
MK_QSL
MVP
MVP

Try this

=Time(Interval#(YourTimeField,'ss'))

master_student
Creator III
Creator III
Author

I tried your solution  Time =Time(Interval#(fabs(TIME),'ss')) and here's the result :

TIME en secondTIME
36 
1200:00:02
2400:00:04
2400:00:04
9500:00:19
22500:00:45
100 
8000:00:20
10800:00:27
2118 
1416 
705 
15 
324 
15000:00:30
225 
26000:00:52
2118 
73200:02:02
2000:00:02
1000:00:02
132 
9500:00:19
95 
5 
1000:00:02
67000:02:14
0 
13500:00:27
13500:00:27
400:00:01
8500:00:17
8500:00:17
174 
1368 
8500:00:17
480 
528 
48 
180 
17500:00:35
126 
126 
12600:00:21
384 
15200:00:38
20 
500:00:01
19000:00:38
1200:00:03
3000:00:05
3000:00:05
490 
275 
4800:00:08
4800:00:08
240 
672 
90 
836 
10400:00:26
180 
165 
655 
190 
318 
4000:00:10
30600:00:51
30600:00:51
7200:00:12
7200:00:12
4400:00:11
420 
500:00:01
845 
486 
372 
96 
2400:00:04
192 
192 
375 
500:00:01
11600:00:29
8400:00:28
9200:00:23
200 
4000:00:04
5200:00:13
84 
12500:00:25
600:00:01
3000:00:03
76000:02:32
13500:00:27
13500:00:27
4800:00:08
4800:00:08
1098 
348 
6000:00:10
14400:00:24
10200:00:17
84000:02:20
18 
600:00:01
395 
72 
260 
13500:00:27
125 
12500:00:25
2400:00:04
2400:00:04
12 
3600:00:03
1800:00:03
28 
12400:00:31
792 
312 
234 
1200:00:02
6800:00:17
762 
19600:00:49
19600:00:49
225 
400:00:01
400:00:01
9000:00:18
45 
35 
2000:00:04
430 
27000:00:54
2000:00:04
55 
8800:00:22
296 
488 
1840 
2000:00:04
380 
176 
12000:00:24
13200:00:22
13200:00:22
10800:00:18
10800:00:18
34000:01:08
2400:00:04
2400:00:04
192 
350 
11200:00:28
132 
40 
1000:00:02
180 
500:00:01
12400:00:31
316 
112 
12400:00:31
1385 
201500:06:43
264 
368 
12500:00:25
12500:00:25
108 
160 
1500:00:03
16000:00:32
128 
28 
330 
1500:00:03
1500:00:03
22500:00:45
1200:00:02
13000:00:26
3000:00:06
4500:00:15
1600:00:04
24000:00:24
8000:00:16
13200:00:33
12000:00:24
1668 
196000:08:10
256 
2000:00:02
16500:00:33
62500:02:05
102 
2400:00:04
252 
4200:00:07
4200:00:07
220 
255 
2500:00:05
9600:00:24
45 
45 
8 
336 
18000:00:36
1145 
31500:01:03
170 
500:00:01
130 
210 
605 
173400:04:49
173400:04:49
120 
60 
11000:00:22
5100:00:17
834 
6000:00:15
21000:00:42
532 
8000:00:20
2400:00:04
2400:00:04
42 
12 
40 
120 
110 
3500:00:07
18000:00:45
7500:00:15
424 
692 
1000:00:02
1000:00:02
245 
245 
440 
60 
800:00:02
240 
42 
42 
10000:00:20
121000:04:02
100 
720 
3600:00:06
10000:00:20
19000:00:38
1000:00:02
1800:00:03
1800:00:03
360 
4200:00:07
210 
125 
78 
81600:02:16
835 
84000:02:48
21000:00:42
35 
500:00:01
1600:00:04
66000:02:45
660 
33000:01:06
12000:00:24
2500:00:05
56 
15 
6500:00:13
1000:00:02
1000:00:02
150 
150 
1500:00:03
330 
12 
85 
8500:00:17
260 
12000:00:24
1500:00:03
1500:00:03
1200:00:02
1200:00:02
605 
8500:00:17
256 
12 
78 
22500:00:45
12800:00:32
1200:00:01
600:00:01
285 
34800:01:27
400:00:01
1500:00:03
196 
25 
20000:00:40
128 
342 
9200:00:23
190 
195 
1150 
155400:04:19
155400:04:19
1000:00:02
1000:00:02
385 
15 
4200:00:07
4200:00:07
138 
136 
1000:00:02
1000:00:02
5 
1962 
1506 
396 
1500:00:03
1500:00:03
280 
1000:00:02
2292 
738 
7500:00:15
88500:02:57
304 
3500:00:07
1000:00:02
110 
6 
395 
1500:00:03
11000:00:22
120 
7800:00:13
45000:01:15
70 
60 
10800:00:18
75 
4500:00:09
15600:00:39
60 
90 
325 
130 
852 
14000:00:28
14000:00:28
6000:00:10
3600:00:06
95400:02:39
60 
282 
27600:00:46
290 
78 
25800:00:43
25800:00:43
665 
12000:00:24
156 
156 
12 
11600:00:29
3 
5000:00:10
240 
11200:00:28
4 
17500:00:35
1700 
71500:02:23
1800:00:03
400:00:01
327 
285 
16800:00:28
312 
1200:00:01
40 
1500:00:03
80 
150 
1500:00:03
12 
300:00:01
100 
195 
500:00:01
360 
116 
585 
6600:00:11
2400:00:06
1190 
530 
32000:01:04
9000:00:18
7000:00:14
270 
356 
2400:00:06
1356 
680 
38000:01:16
1308 
1332 
240 
132 
1000:00:02
500:00:01
2500:00:05
12500:00:25
108 
2000:00:04
126 
1302 
100 
195 
12000:00:24
9500:00:19
7500:00:15
233000:07:46
3 
28000:00:56
0 
126 
600:00:01
370 
7600:00:19
245 
235 
2000:00:04
12000:00:24
1800:00:03
200 
2400:00:04
2400:00:04
590 
330 
7800:00:13
265 
7800:00:13
7800:00:13
138 
1800:00:03
145 
152 
304 
112 
1200:00:02
1200:00:02
145 
2000:00:02
1000:00:02
150 
13000:00:26
41500:01:23
5600:00:14
212 
8000:00:16
18800:00:47
420 
1800:00:03
1800:00:03
16500:00:33
324 
2400:00:04
14400:00:36
10000:00:25
400:00:01
840 
840 
155 
9000:00:18
216 
10 
740 
10000:00:20
10000:00:20
50 
162 
24000:00:48
1200:00:02
3600:00:03
100 
54500:01:49
15500:00:31
76000:02:32
75 
135 
284 
13500:00:27
5 
28 
72 
1000:00:02
240 
1266 
125 
30000:01:00
20 
85 
85 
10800:00:27
175 
15200:00:38
15200:00:38
148 
3600:00:06
3600:00:06
72 
110 
6000:00:10
6000:00:10
100 
82000:02:44
82500:02:45
16 
610 
300 
1200:00:02
1200:00:02
26500:00:53
3300:00:11
20 
252 
500:00:01
14400:00:24
16800:00:28
105 
1500:00:03
100 
48 
1500:00:03
10000:00:20
332 
16800:00:28
3000:00:05
215 
215 
205 
205 
475 
1800:00:03
1800:00:03
575 
13500:00:27
10000:00:20
90 
1008 
400:00:01
1476 
1476 
210 
4000:00:08
4000:00:08
1000:00:02
22000:00:44
22000:00:44
18 
18 
595 
1200:00:02
1200:00:02
5400:00:09
8 
30 
260 
11400:00:19
10800:00:18
80 
1800:00:03
1800:00:03
132 
28000:00:56
60 
50 
500:00:01
1200:00:03
600:00:01
600:00:01
42 
39000:01:05
430 
1500:00:03
102000:03:24
800:00:02
1000:00:02
11400:00:19
11400:00:19
5500:00:11
5500:00:11
384 
840 
188 
295 
1800:00:03
1800:00:03
55 
10500:00:21
143500:04:47
702 
702 
145 
1500:00:03
15 
128 
7200:00:12
7200:00:12
1200:00:02
1200:00:02
Anil_Babu_Samineni

Seems, This consist as different time

Can you try this?

Time(Interval#(fabs(TIME),'ss')) * 60 // If not, Try with / 60

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MK_QSL
MVP
MVP

I haven't asked you to use Fabs function... !!!

master_student
Creator III
Creator III
Author

Hello

my field in negative this is why I am using fabs function

master_student
Creator III
Creator III
Author

it gives wrong result Anil :

 

TIME en secondTIME
36
123,86E-07
247,72E-07
247,72E-07
953,67E-06
2258,68E-06
100
803,86E-06
1085,21E-06
2118
1416
705
15
324
1505,79E-06
225
2601,00E-05
2118
7322,35E-05
203,86E-07
103,86E-07
132
953,67E-06
95
5
MK_QSL
MVP
MVP

Load *,Time(Interval#(Fabs(TimeField),'ss')) as Time Inline

[

  TimeField

  36 

  12

  24

  24

  95

  -225

  -100 

  128 

];

master_student
Creator III
Creator III
Author

I am sorry, my time field is in minutes...

MK_QSL
MVP
MVP

use

Time(Interval#(Fabs(TimeField),'mm')) as Time