2 Replies Latest reply: Jun 25, 2012 3:28 PM by Jose Tos RSS

    Group by question

    Jose Tos

      Hi everyone,

       

      This is the thing:

       

      Imaging that I have this fields:

      GroupCategoryDateAmount

       

      Now I want to calculate the max(Amount) and get the date of that maximum grouping by Group and Category.

      And this is the problem:

      If I do the group by with Group and Category, I don´t know in which date I had the maximum, the solution I thought is doing a link with the amount or with a key composed by  Group&Category&Amount but I don´t think it would be the best solution, overall if there are repetead maximums.

       

      And I can´t group by Group, Category and Date, because I want the maximum amount of those Dates and not the maximum per day.

      The date must be only an added information field.

       

      If is not clear enough, ask me please.

      I´m doing all in the load script, FYI.

      Any ideas??

      Thank´s