In this session you will learn about Time Dimension table
Time Dimension (or) Date Dimension (or) Master Calender
------------------------------------------------------------------------------------
Year
Quarter
Month
Week
Day
Load Orders Table
Sort Orders Table in the ascending order of OrderDate
Extract Min Date and Max Date by using Peek() and keep in variables(vMinDate, vMaxDate)
Create a Temp Table contain TempDate having Dates from vMinDate to vMaxDate
Create Actual Time Dimension Table by applying Date Functions
Drop Temp Table
LET vMinDate=Num(Peek('OrderDate',0,'OrderSort')); // 01-01-2015
LET vMaxDate=Num(Peek('OrderDate',-1,'OrderSort')); // 31-01-2015
Temp:
LOAD Date($(vMinDate)+RecNo()-1) as TempDate AutoGenerate 31;
01-01-2015 + 1 - 1 = 01-01-2015
01-01-2015 + 2 - 1 = 02-01-2015
01-01-2015 + 3 - 1 = 03-01-2015
---
---
01-01-2015 + 31 - 1 = 31-01-2015
Ceil(Month(TempDate)/3)
1/3=0.333=1
2/3=0.666=1
3/3=1
4/3=1.333=2
5/3=1.666=2
6/3=2
7
8
9
10
11
12