5 Replies Latest reply: Nov 10, 2016 9:56 PM by MARCO HADIYANTO RSS

    Duration between Max date and Min date in selected Month

    Mohammad Sarif

      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