Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

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

1 Solution

Accepted Solutions
marcohadiyanto
Partner - Specialist
Partner - Specialist

Hi Sarif,

Here's QVW..

Regards,

Marco

View solution in original post

5 Replies
sunny_talwar

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

mhmmd_srf
Creator II
Creator II
Author

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 IDBeginEnd
12-Oct-163-Oct-16
28-Oct-169-Oct-16
315-Oct-1616-Oct-16
42-Nov-163-Nov-16
55-Nov-166-Nov-16

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

Please help.

Thanks,

Sarif

marcohadiyanto
Partner - Specialist
Partner - Specialist

Hi Sarif,

Please find attached file. is that your req?

Regards,

Marco

mhmmd_srf
Creator II
Creator II
Author

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

marcohadiyanto
Partner - Specialist
Partner - Specialist

Hi Sarif,

Here's QVW..

Regards,

Marco