3 Replies Latest reply: Jun 28, 2013 1:07 PM by Aji Paul RSS

    Simple Load Question

      Hi All,

       

      Need some help with a simple load problem.

       

      I have a simple sales table , it has Account ID, Sales Channel, order ID and Order Date. (load script below)

       

      It has two accounts and 4 orders for each accounts.

       

       

      SALES:

      load * inline

      [ACC, CHNL, ORD_ID, PROD    , DT

      AC123, Web, ORD1, DVD, 1/1/2012

      AC123, STORE, ORD2,CD, 1/1/2013

      AC123, Phone,ORD3, BOOK, 1/1/2010

      AC123, Web,ORD4,TSHIRT, 1/1/2011

      AC980, Store,ORD5,BOOK, 2/1/2010

      AC980, Phone,ORD6,TSHIRT, 2/1/2011

      AC980, Web,ORD7,DVD, 2/1/2012

      AC980, Web,ORD8,CD, 2/1/2013];

       

       

      After loading this what I would like to extract the DISTINCT Account IDs and their fist order information and create a new table.(the blue records alone)

      Can we use some kind of ranking ?

       

      As example , from the above scanrio , it should create the following two records

      Ex.

      AC123, Phone,ORD3, BOOK, 1/1/2010

      AC980, Store,ORD5,BOOK, 2/1/2010

       

      Thanks in advance and truly appreciate your help..

       

      Thanks,

      Aji Paul.