Generate Time Data(普通日期主資料)
阿新 • • 發佈:2018-12-27
1. Open the Quick Launch Page
•From the Help Menu > Quick Launch(如果是Eclipse外掛,則為Quick View)
2. Click on “Generate Time Data” under Data.
3. Enter the following entries.
•Select Gregorian as the Calendar Type.
•Enter 2010 to 2011 (you can use any year)
•Select DAY for the Granularity
•Click Generate.
4. Check the Generated data within the table “_SYS_BI.M_TIME_DIMENSION”. There should be an entry for every DAY between 2010 and 2011.
5. Create an Attribute view
生成時間屬性檢視,以便使用上面生成的Day時間主資料
•Right Click on Attribute View > New > Attribute View.
6. Enter “TIME_01” for the name of the view
•Select Time ->Gregorian.(當然,也可以不選擇Time,Atrribute View Type直接設定為預設的Standard標準也是可以的,這樣就需手動將相應粒度的維度拖進屬性檢視了,只不過這裡建立時間屬性檢視時,會自動根據你選擇的時間粒度將相應的時間維表加進來而已,這樣方便快捷 )
•For the Granularity select “Date”
•Click on Auto Create.
•Click Finish.
7. As a result you will see the Dimensions table with the generated Attributes. Optionally you can remove any attribute fields that are not needed.
當選擇屬性檢視型別為Time型別時,根據你選擇的時間粒度Granularity,自動將相應的時間表(這裡為_SYS_BI.M_TIME_DIMENSION)加入到屬性檢視中,並且預設將這個時間維表裡的所有欄位做為檢視的輸出欄位,你可以根據實際的需要刪除一些不需要的屬性欄位
8. Save the view first. Right Click on the Attribute View > Activate.
9. Right Click on the Attribute View > Preview.
10. Create the Analytical view and use the Attribute view: “TIME_01”
在分析檢視中使用上面建立的時間屬性檢視
11. Enter “AN_TIME_00” for the name of the view.
•Click finish.
12. Click on Add link
•Search for CE1IDEA table(CE1IDEA應該是個業務資料表)
•Click Ok
13. Add HZDAT as an Attribute. Right click on HZDAT(HZDAT為到天的且帶日期格式的日期,10位,日期格式應該與當前登入的國家語言環境有關) > Add as Attribute.
14. Open the Logical View(新版本的Studio應該是Star Join). Click on the tab ‘Logical View’ at the bottom of the detail screen.
•Drag TIME_01 attribute view in Window.將TIME_01時間屬性視圖裡的DATE_SQL拖到業務表的HZDAT時間欄位上,產生關聯
•Create a Referential (n ..1) Join between TIME_00.DATE_SQL and Data Foundation HZDAT field.
15. Activate & Preview.
這樣就可以對業務表CE1IDEA按季度(QUARTER)進行分析了(當然也可以按照月MONTH時間維度進行資料分析)