Hi all,
I have a question. How to create a time-based sales database and get the correct sales for my query? Given that my time table doesn't follow a Julian calendar.
For example, if I have three tables. The time table, the territory table and the sales table.
Time Table
Territory Table
Sales Table Recorded Jim's sales number for Period 1- Period12
From the territory table, Jim starts working in North East from Period 1 - Period 5. Then he moved to Central from Period 6 - Period 12. And I want to know the sales for North East, say, in Period 3, etc.
How should I construct this database and establish the relationship between the Time table and Territory table?
Thank you very much for your help!
I have a question. How to create a time-based sales database and get the correct sales for my query? Given that my time table doesn't follow a Julian calendar.
For example, if I have three tables. The time table, the territory table and the sales table.
Time Table
Code:
PeriodID PeriodStart PeriodEnd
2014, PERIOD 01 1/1/2014 2/1/2014
2014, PERIOD 02 2/2/2014 3/1/2014
2014, PERIOD 03 3/2/2014 3/29/2014
2014, PERIOD 04 3/30/2014 5/3/2014
2014, PERIOD 05 5/4/2014 5/31/2014
2014, PERIOD 06 6/1/2014 6/28/2014
2014, PERIOD 07 6/29/2014 8/2/2014
2014, PERIOD 08 8/3/2014 8/30/2014
2014, PERIOD 09 8/31/2014 9/27/2014
2014, PERIOD 10 9/28/2014 11/1/2014
2014, PERIOD 11 11/2/2014 11/29/2014
2014, PERIOD 12 11/30/2014 12/31/2014
Territory Table
Code:
Territory SalesRepName StartDate EndDate
North East Jim 1/1/2014 5/31/2014
Central Jim 6/1/2014 12/31/2014
Sales Table Recorded Jim's sales number for Period 1- Period12
Code:
SalesRepName PeriodID Sales
Jim 2014, Period 01 1,500
Jim 2014, Period 02 2,500
.
.
.
Jim 2014, Period 12 4,500
From the territory table, Jim starts working in North East from Period 1 - Period 5. Then he moved to Central from Period 6 - Period 12. And I want to know the sales for North East, say, in Period 3, etc.
How should I construct this database and establish the relationship between the Time table and Territory table?
Thank you very much for your help!