1 Reply Latest reply: May 23, 2016 5:10 AM by Onno van Knotsenburg RSS

    Divide by month / Year

    Marco Vicariucci

      Hi everyone,

       

      I have to load some data and group by month and year. The field "SIMPLEDATE" is composed of Year-Month-Day (2015-11-30).
      I need to divide this field and create two new field, YEAR and MONTH, so I can group by with this two new fields.

       

       

      I have this script:

      LOAD

       

        SIMPLEDATE

        count(*) as rich_totali

        

        

      FROM  [log.qvd]

      (qvd)

       

      group by

       

      SIMPLEDATE
      store * from log into [ogSintesi.qvd] (qvd);

      _____________________________________________________________

       

      I need something like this

      LOAD

           Year([SIMPLEDATE]) as YEAR,

           Month([SIMPLEDATE]) as MONTH,

      count(*) as rich_totali

        

        

      FROM  [log.qvd]

      (qvd)

       

      group by

       

      YEAR,

      MONTH,
      store * from log into [ogSintesi.qvd] (qvd);