// =========== Get First and Last Date in Orders Table ==================
Let vCYear = Year(today());
Let vLYear = Year(today())-1;
Let vFirstDate = MakeDate($(vLYear),1,1) ;
Let vLastDate = MakeDate($(vCYear),12,31); 
Let vDateZero = vFirstDate - 1;
// =========== Dates ==================
[Time Dimension]:
Load distinct *,
 Dual('Q' & ceil(Month/3), ceil(Month/3))  as OrderQuarter;
Load *,
 Date(MonthStart(CREATEDATE),'YYYY-MMM') as YearMonth,
 Year(CREATEDATE)  as Year,
 Month(CREATEDATE)  as Month,
 Week(CREATEDATE)  as Week,
 Day(CREATEDATE)   as Day,
 WeekDay(CREATEDATE)  as WeekDay ;
Load
 Date($(vDateZero) + recno()) as CREATEDATE
Autogenerate vLastDate - vDateZero;
a photo speaks a thousand words
Subscribe to:
Post Comments (Atom)
Total Pageviews
Categories
License
Blog Archive
- 
        ▼ 
      
2011
(51)
- 
        ▼ 
      
April
(23)
- 二月二十九生日的人 好可怜哦, 他们四年才生日一次, 四年可以庆祝一次,每次快生日了,却发现少了二月...
- 2011/04/27
- 信用卡
- 情侣
- 2011/04/26
- Super Duper Camera
- Sesco KWB
- Time Dimension
- Determine left right and middle mouse button click
- Descending order
- 蔡依林 - 即时生效
- 99th anniversary of the sinking of the Titanic
- [转]上镜的办法
- 2011-04-15
- Count Record Which Met Condition
- [转] 最糗的事
- [转] 但这些歌在一起时
- [转] 翻跟斗
- [转] 上廁所忘帶紙
- 311 Japan EarthQuake
- Sort Table Content
- 2011-04-07
- Date- Set Today's Date to ComboBox
 
 
- 
        ▼ 
      
April
(23)
 
 
 
 
 
0 comments:
Post a Comment