11 Replies Latest reply: Jun 11, 2015 12:37 PM by pratap budati RSS

    Average sum group by months in  load script

    Андрей Шепель

      Good day!

      In load script i load table from excel:

       

      Main:

      LOAD

        Id,

        Year(Date)&num(Month(Date),'00') as YearMonth,

        avg(Sum)

        FROM

      $(DataPath)Test.xlsx

      (ooxml, embedded labels, table is Sheet1)

      ;

       

      in result i get table:

        

      IdDateSum
      101.01.20154
      102.01.20156
      103.01.20154
      104.01.20156
      105.01.201537
      106.01.20154
      107.01.20152
      108.01.20157
      109.01.20154
      101.02.20154
      102.02.20156
      103.02.20153
      104.02.20156
      105.02.20153
      106.02.20151
      107.02.20153
      108.02.20155
      109.02.201576

      How i load script calculate average sum group by YearMonth?

       

      My necessary result:

      Id     YearMonth     Sum

      1     201501     8.2

      1     201502    11.8

       

      Thanks.