5 Replies Latest reply: Nov 10, 2016 9:56 PM by marco hadiyanto

Duration between Max date and Min date in selected Month

Hi All,

I have a field called begin in YYYY-MM-DD hh:mm:ss format. I need to calculate the duration between Max(begin) and Min(begin), which is working good. But I want to make this for max month. how to do this?

set v1=max(begin);

set v2 = min(begin);

In KPI Expression:   Interval(\$(v1) - \$(v2) ,'mm')*1440 --- this is working fine.

[begin] AS [begin],

Date(MonthStart(date#([begin],'YYYY-MM-DD hh:mm:ss')), 'MMM-YYYY')  as Begin_Month_Year,

Set vMaxMonthOutage= max(Begin_Month_Year);

I want to apply this vMaxMonthOutage variable in interval expression. How to do this? Or any other way?

Thanks,

Sarif

• Re: Duration between Max date and Min date in selected Month

Not entirely sure I understand your context here, can you provide a little more details as to what you are trying to do?

• Re: Duration between Max date and Min date in selected Month

Hey Sunny,

I want to calculate the duration in Minutes for between Maximum of Begin and Minimum of begin. that would be by default for current month. Lets say we have a table outage. Which is having data for system outage.

 Outage ID Begin End 1 2-Oct-16 3-Oct-16 2 8-Oct-16 9-Oct-16 3 15-Oct-16 16-Oct-16 4 2-Nov-16 3-Nov-16 5 5-Nov-16 6-Nov-16

I want to calculate 5-Nov-2016 - 2-Nov-2016 in minutes.

Thanks,

Sarif

• Re: Duration between Max date and Min date in selected Month

Hi Sarif,

Regards,

Marco

• Re: Duration between Max date and Min date in selected Month

Hi Marco,

Can you please make the same thing qvw? I do not have access to Qlik server or not have Qlik desktop.

Thanks a lot

Sarif

• Re: Duration between Max date and Min date in selected Month

Hi Sarif,

Here's QVW..

Regards,

Marco