Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
mhmmd_srf
Contributor II

Need to change into d:hh:mm format

Hi All,

I have an filed called MTBF which is in Minutes.

The expression is below:

(((Outage_Sys_MonthEndDate - Outage_Sys_MonthStartDate)*24*60) - sum(Outage_OutageDuration)*1440)/count(distinct Outage_sys_id)

I am doing below to change the format:

interval((((Outage_Sys_MonthEndDate - Outage_Sys_MonthStartDate)*24*60) - sum(Outage_OutageDuration)*1440)/count(distinct Outage_sys_id) , 'd:hh:mm')

But still it is showing in minutes.

Please help.

Sarif

1 Solution

Accepted Solutions
Partner
Partner

Re: Need to change into d:hh:mm format

Hi Sharif,

You need to give to interval a value in day. Just divide your value in minutes by (24*60) and you will have the result that you want:

interval(((((Outage_Sys_MonthEndDate - Outage_Sys_MonthStartDate)*24*60) - sum(Outage_OutageDuration)*1440)/count(distinct Outage_sys_id))/(24*60) , 'd:hh:mm')

4 Replies
Partner
Partner

Re: Need to change into d:hh:mm format

Hi Sharif,

You need to give to interval a value in day. Just divide your value in minutes by (24*60) and you will have the result that you want:

interval(((((Outage_Sys_MonthEndDate - Outage_Sys_MonthStartDate)*24*60) - sum(Outage_OutageDuration)*1440)/count(distinct Outage_sys_id))/(24*60) , 'd:hh:mm')

Re: Need to change into d:hh:mm format

Try this line

=interval(( (((Outage_Sys_MonthEndDate - Outage_Sys_MonthStartDate)*24*60) - sum(Outage_OutageDuration)*1440)/count(distinct Outage_sys_id) ) , 'D:hh:mm')

Regards

Anand

mhmmd_srf
Contributor II

Re: Need to change into d:hh:mm format

hi Sebastain,

This is working. Thanks a lot.

If you don't mind could you please explain this.

Thanks,

Sarif

Partner
Partner

Re: Need to change into d:hh:mm format

Interval function request a value in day or fraction of day.

You used this function with value in minutes. By dividing your value by the number of minutes per day (24 * 60) you have the value in fraction of day and it will be correctly interpreted by Interval function.