4 Replies Latest reply: Jul 17, 2012 4:14 PM by Justin Kelly RSS

    Need More Efficient "Group By" Load

    Justin Kelly

      Hi Everybody,

       

      I'm trying to find a more efficient way to create a table that sums and groups records by a certain key. I have the following data that I want to load:

       

      Order_NumberProductDateOrder_QuantityQuantity_Filled
      100001Product_106/01/20122920
      100001Product_206/01/20121313
      100001Product_306/01/2012143
      100002Product_107/10/20121111
      100002Product_207/10/20121111
      100002Product_307/10/20121717
      100003Product_107/12/20122825
      100003Product_307/12/2012180

       

      I will only need to look at this data by Product and Month. I don't need it broken down by Order_Number or a specific date.

       

      The only way I know how to do this is to create separate tables, make a Product_Date_Key, create another table to sum the data and group by the key, add and drop tables, etc. This works fine but I'd like to have it be more efficient if possible.

       

      The actual data that I'm using is thousands of products on thousands of orders for the last two years.