6 Replies Latest reply: Jun 29, 2015 6:08 AM by Timanshu Virmani RSS

    Mapping Question

    Jason Lai

      Hi All,

       

      I have a data modelling question. I have 2 tables: a standard Transactions table, and a Customer Table.

      The transaction table looks like:

       

      Customer ID | Transaction Date

      123                | 01-01-2015

      123                | 15-02-2015

      123                | 24-04-2015

       

      The Customer Table looks like this: (where the data is updated on a monthly basis for the beginning of the month. The CustomerID can be reused, hence why for April 2015 the Customer ID 123 has been changed to Samsung).

       

      Customer ID | Customer Name | Date

      123               | CocaCola            | 01-01-2015

      123               | CocaCola            | 01-02-2015

      123               | CocaCola            | 01-03-2015

      123               | Samsung             | 01-04-2015

      123               | Samsung             | 01-05-2015

       

      What is the best way of mapping this Customer data into the Transaction table, so I can get something like:

       

      FactTable:

      Customer ID | Customer Name | Transaction Date

      123                | CocaCola           | 01-01-2015

      123                | CocaCola           | 15-02-2015

      123                | Samsung            | 24-04-2015

       

      Cheers,

      Jason