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: 
Not applicable

Convert HH:MM:SS in days for average expression in chart as table

Dear Experts,

Help required to get the MTTR average for EQUNR_V in Days.

MTTR  is in HH:MM:SS now i need to get average in days.

In Load statement MTTR is calculated as below.

Interval((Date#(AUSBS,'M/D/YYYY')+time(AUZTB,'HH:mm:SS'))-(Date#(AUSVN,'M/D/YYYY')+time(AUZTV,'HH:mm:SS')),'hh:mm') as MTTR,

EQUNR_VEQM_AUSVNEQM_AUZTVEQM_AUSBSEQM_AUZTBMTTR
212202014-05-2410:42:242014-05-2417:45:507:03:26
212202014-05-3112:15:452014-05-3114:29:302:13:45
212202014-06-1015:12:252014-06-1016:05:250:53:00
212202014-08-1209:35:332014-08-1210:55:001:19:27
212202014-09-0709:11:562014-09-0712:25:153:13:19
212202014-09-0810:26:162014-09-0814:25:403:59:24
212202014-09-2410:34:292014-09-2411:25:320:51:03
212202014-10-0811:47:572014-10-0816:25:224:37:25
212202014-10-1311:01:112014-10-1312:25:401:24:29
212202014-10-3012:09:592014-10-3013:00:000:50:01
212202014-11-0710:57:112014-11-0714:25:473:28:36
212202014-11-1310:54:102014-11-1311:30:140:36:04
212202014-12-0310:41:262014-12-0310:55:400:14:14
212202014-12-0910:04:032014-12-0910:30:470:26:44

Thanks

Ashif

1 Solution

Accepted Solutions
MarcoWedel

Dimension:EQUNR_V

Expression: Interval(Avg(MTTR),'d hh:mm:ss')

View solution in original post

6 Replies
anbu1984
Master III
Master III

Tbl:

Load * Inline [

EQUNR_V,AUSVN,AUZTV,AUSBS,AUZTB,MTTR

21220,2014-05-24,10:42:24,2014-05-24,17:45:50,7:03:26

21220,2014-05-31,12:15:45,2014-05-31,14:29:30,2:13:45

21220,2014-06-10,15:12:25,2014-06-10,16:05:25,0:53:00

21220,2014-08-12,09:35:33,2014-08-12,10:55:00,1:19:27

21220,2014-09-07,09:11:56,2014-09-07,12:25:15,3:13:19

21220,2014-09-08,10:26:16,2014-09-08,14:25:40,3:59:24

21220,2014-09-24,10:34:29,2014-09-24,11:25:32,0:51:03

21220,2014-10-08,11:47:57,2014-10-08,16:25:22,4:37:25

21220,2014-10-13,11:01:11,2014-10-13,12:25:40,1:24:29

21220,2014-10-30,12:09:59,2014-10-30,13:00:00,0:50:01

21220,2014-11-07,10:57:11,2014-11-07,14:25:47,3:28:36

21220,2014-11-13,10:54:10,2014-11-13,11:30:14,0:36:04

21220,2014-12-03,10:41:26,2014-12-03,10:55:40,0:14:14

21220,2014-12-09,10:04:03,2014-12-09,10:30:47,0:26:44 ];

Load EQUNR_V,Interval(Avg((Date#(AUSBS,'YYYY-MM-DD')+time(AUZTB,'HH:mm:SS'))-(Date#(AUSVN,'YYYY-MM-DD')+time(AUZTV,'HH:mm:SS'))),'hh:mm') as MTTR1,Time(Avg(Time#(MTTR,'hh:mm:ss'))) Resident Tbl Group By EQUNR_V;

Not applicable
Author

Thanks Anbu,

I Dont want in load statement. I want in chart expression Avg of MTTR in days.

Regards

Ashif

anbu1984
Master III
Master III

Dimension: EQUNR_V

Expression:

1.Avg(MTTR)

2.Avg((Date#(AUSBS,'YYYY-MM-DD')+time(AUZTB,'HH:mm:SS'))-(Date#(AUSVN,'YYYY-MM-DD')+time(AUZTV,'HH:mm:SS')))

146805.png

MarcoWedel

Dimension:EQUNR_V

Expression: Interval(Avg(MTTR),'d hh:mm:ss')

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try

Avg(Interval(TimeStamp#(MTTR, 'h:mm:ss'), 'ss'))/86400

Regards,

Jagan.

Not applicable
Author

Thanks. I came across the same.