3 Replies Latest reply: Aug 26, 2015 4:04 PM by Rodrigo Camerin RSS

    Group By one column only - max date

    Rodrigo Camerin

      Hi Qlik Communty:

       

      So, I have this Table1:

       

      TABLE1:
      ORDERX_FIELDDATE
      10001220/08/2015
      10001415/08/2015
      10002419/08/2015
      10002420/08/2015
      10002221/08/2015
      10003418/08/2015
      10003220/08/2015

       

      and need to Group By ORDER showing the max(DATE) and X_FIELD, something like this:

       

      ORDERX_FIELDDATE
      10001220/08/2015
      10002221/08/2015
      10003220/08/2015

       

      If I write this:

       

      Table2:

      LOAD ORDER, X_FIELD, MAX(DATE) AS DATE

      RESIDENT TABLE1 GROUP BY ORDER

       

      I got an error because X_FIELD is missing after ORDER in Group By.

       

      If I write GROUP BY ORDER, X_FIELD

      I got a diferent result from the one I am expecting (above).

       

      Thanks for your help,