Hi everyone,

I’m using the code below to calculate the moving average on some data. 

Table averageJudgeByPhaseReport = filteredPhasesDurationsTable
       .window(Slide.over(lit(WINDOW_SIZE_IN_DAYS_REPORT).days())
             .every(lit(WINDOW_SLIDE_IN_DAYS_REPORT).days())
             .on($(“end_date"))
             .as("w"))
       .groupBy(
             $(“office"),
             $(“section"),
             $(“judge"),
             $(“phase"),
             $("w")
       )
       .select(
             $(“office"),
             $("section"),
             $(“judge"),
             $(“phase"),
             $("duration").avg().as(“average"),
             $("w").end().as(“end_date")
       );


After that I need to calculate the median value of the averages, grouped by 
‘office’, ‘section’ and ‘phase’ in the same time window.
Any suggestion? 

Thanks
Eugenio


Reply via email to