IBM Cognos BI 最佳實踐: Cognos 8.3 中的動態儀表板

IBM Cognos BI 最佳實踐: Cognos 8.3 中的動態儀表板

本文的目的是展示 Cognos 8.3 中的一些 portlet 的動態儀表板功能。本文介紹的內容將概述用於創建可以確保 portlet 間通信的報表和門戶頁面的步驟。

developerWorks 中國網站編輯團隊, 編輯, IBM

2010 年 4 月 22 日

  • +內容

1 簡介

1.1 目的

本文的目的是展示 Cognos 8.3 中的一些 portlet 的動態儀表板功能。本文介紹的內容將概述用於創建可以確保 portlet 間通信的報表和門戶頁面的步驟。

1.2 適用範圍

本文檔中的信息適用於 Cognos 8.3 build 8120-0。

1.3 例外

還有其他一些方法用於實現 Cognos 8.3 portlets,本文沒有討論這些方法。

2 創建一個動態儀表板的步驟

2.1 創建一個 Crosstab 報表

這個任務將創建一個 Crosstab 報表,用於檢查 Global Filtering 的行爲和 Global Drill 的向上和向下鑽取行爲。

1) 在 Great Outdoors Company 包下創建一個文件夾 Global Filters,然後在此文件夾中導航。

2) 啓動 Report Studio,然後選擇 Great Outdoors Company。

3) 單擊 Create a New Report 或 Template,然後雙擊 Crosstab 圖標。

4) 創建一個帶有以下項的新的 Crosstab 報表:

  • 行內容爲 \Products\Products\Product line (level)
  • 列內容爲 \Years\Years\Year (level)
  • Measure 爲 \Measures\Revenue

5) 選擇任意 Crosstab Intersection,然後單擊工具欄中的 Aggregate 按鈕。在可用聚合中選擇 Total。完成後,這個 Crosstab 應該表示下表:

Crosstab 表

6) 選擇這個 Crosstab 中的任一項,然後從 Table 菜單選擇 Appl Table Style。

7) 選擇樣式 Accounting 1 並單擊 OK 按鈕。

應用 Accounting 樣式

8) 選擇這個 Crosstab 中的任一數據項,右鍵單擊並選擇 Go to Query。

2.1.1 創建並顯示 Dynamic Crosstab Slicer

爲過濾數據,需要創建以下 slicer 表達式:

[great_outdoors_company] . [Sales Territory] . [Sales Territory] . [Country]->?pCountry?

創建所需的 slicer 表達式需要以下幾個步驟:

1) 在 Insertable Object 中選擇 Toolbox 選項卡,然後將一個 Slicer Member Set 插入 Slicer 窗口。

2) 將 Sales Territory > Sales Territory > Country(這是 Country 級別)插入表達式窗口。

3) 將以下語法附加到表達式末尾:->?pCountry?。

這個表達式包含一個 Dash、Greater Then Sign、Question Mark、參數名稱和一個 Question Mark,它將自動提示將用作過濾器的國家。

4) 單擊兩次 back 按鈕,回到報表頁面。

回到報表頁面

以下步驟將插入一個文本框,這個文本框用於顯示用戶選擇的 pCountry 參數的值。

5) 單擊在 Insertable Objects 中的 Toolbox 選項卡。

6) 在這個 Crosstab 之前插入一個 Layout Calculation。

7) 在 Available Components 窗口中,單擊位於 Report Expression 對話框底部的 Parameters 選項卡。

設置 Parameters 選項卡

8) 將 pCountry 參數拖動到 Expression Definition,這個表達式應該爲:ParamDisplayValue('pCountry')。

設置表達式

9) 單擊 OK。

2.1.2 啓用 Drill Behaviour

1) 要獲得更動態的報表,需要啓用 Drill-up 和 Drill-down Report drill 功能。爲此,選擇 Data 菜單並選擇 Drill Behavior。

2) 選中 Allow drill-up and drill-down 並單擊 OK。

設置向上和向下鑽取

2.1.3 設置默認提示值

爲確保在這個 portlet 中執行和顯示這個報表,需要爲此前創建的 pCountry 提示設置一個默認值。爲此,執行以下步驟:

1) 在 Page Explorer 中選擇 Prompt Pages。

2) 雙擊 Insertable Objects Pane 中的頁面圖標,創建一個新的提示頁面。

3) 雙擊 Prompt Pages 窗格中的 Prompt Pagel 圖標,顯示提示頁面。

4) 從 Insertable Objects 中拖動一個 Value Prompt 到這個提示頁面上。這將爲這個 Value Prompt 顯示 Prompt Wizard。

5) 單擊 Use existing parameter 選項並從下拉列表選擇 pCountry 參數。

使用已有的 pCountry 參數

6) 單擊 Next 按鈕。

7) 在下一個 Wizard 對話框(Populate control)中單擊 Finish 按鈕,創建第 2 個使用 Country Level 的查詢。

創建第 2 個使用 Country Level 的查詢

8) 要爲這個提示頁面添加一個默認值 Canada,突出顯示頁面上的 Value Prompt。在頁面底部的左側窗格 Properties 中,選擇 Default Selections 並單擊省略號。這將調用 Default Selections 對話框。

調用 Default Selections 對話框

9) 單擊 Add 按鈕以添加一個新的 Default Selection。

10) 爲 Canada 輸入 Member Unique 名稱。這個示例中的值爲:

[Great_Outdoors_Company].[Sales Territory].[Sales Territory].[Country]-
>:[PC].[@MEMBER].[4]

爲 Canada 輸入 Member Unique 名稱

11) 單擊兩次 OK,關閉 Add 和 Default Selections 對話框。

12) 下圖是這個 Value Prompt 的 Properties 概覽。

Value Prompt 的 Properties 概覽

13) 運行報表,向下鑽取各行,確保報表能夠成功運行。完成後關閉 Cognos Viewer。

14) 將報表保存爲 3 Years Product Summary。確保將報表保存在路徑 Public Folders > Great Outdoors Company > Global Filters 中。

不要關閉 Report Studio,因爲下面的任務將用到它。

2.2 創建 Chart 報表

本小節將介紹創建一個 Chart 報表所需的步驟。這種圖表報表將提供數據的直觀表示。要創建 Chart 報表:

1) 創建一個新報表並雙擊 Chart 圖標。

2) 選擇 Stacked Column 圖表並單擊 OK。

3) 使用 \Years\Years\Year (level) 作爲 Category。

4) 使用 \Products\Products\Product line (level) 作爲 Series。

5) 使用 \Measures\Revenue 作爲 Default measure。

設置 Default measure

6) 選擇 Chart 以在左下方的窗口中啓用 Combination Chart Properties 窗格。

7) 在 Properties 窗口中,向下滾動到 Color & Background 部分,選擇 Palette 框,然後單擊省略號打開 Palette 窗口。

8) 單擊 word Palette 並選擇 Modern。完成後單擊 OK。

完成設置

2.2.1 創建並顯示 Dynamic Chart Slicer

1) 右鍵單擊圖表並選擇 Go to Query。

2) 在 Insertable Object 中選擇 Toolbox 選項卡,然後將一個 Slicer Member Set 插入 Slicer 窗口中。

3) 將 Sales Territory > Sales Territory > Country (level) 插入表達式窗口中。

4) 將以下語法附加到表達式的末尾:->?pCountry?

這個表達式包含一個 Dash、Greater Then Sign、Question Mark、參數名稱和一個 Question Mark。這裏使用的參數名稱必須與此前創建的 Crosstab 報表中使用的參數名稱匹配。

5) 單擊 back 按鈕,返回頁面。

返回頁面

6) 在 Insertable Objects 窗格中單擊 Toolbox 選項卡,將一個 Block 對象拖動到圖表前面。

7) 將一個 Layout Calculation 插入此前添加的 Block 中。

8) 在 Report Expression 對話框中,選擇 Parameters 選項卡。

選擇 Parameters 選項卡

9) 將 pCountry 參數拖到 Expression Definition。這個表達式應該爲:

ParamDisplayValue('pCountry')

設置 pCountry 表達式

10) 完成後單擊 OK。

11) 將 Layout Calculation 的字體更改爲 Size 12 和 Bold。

2.2.2 啓用Drill Behaviour

1) 要獲得更動態的報表,需要啓用 Drill-up 和 Drill-down Report drill 功能。爲此,選擇 Data 菜單並選擇 Drill Behavior。

2) 選中 Allow drill-up and drill-down 並單擊 OK。

選中 Allow drill-up and drill-down

2.2.3 設置默認提示值

爲確保在這個 portlet 中執行和顯示這個報表,需要爲此前創建的 pCountry 提示設置一個默認值。爲此,執行以下步驟:

1) 在 Page Explorer 中選擇 Prompt Pages。

2) 雙擊 Insertable Objects Pane 中的頁面圖標,創建一個新的提示頁面。

3) 雙擊 Prompt Pages 窗格中的 Prompt Pagel 圖標,顯示提示頁面。

4) 從 Insertable Objects 中拖動一個 Value Prompt 到這個提示頁面上。這將爲這個 Value Prompt 顯示 Prompt Wizard。

5) 單擊 Use existing parameter 選項並從下拉列表選擇 pCountry 參數。

選擇 pCountry 參數

6) 單擊 Next 按鈕。

7) 在下一個 Wizard 對話框(Populate control)中單擊 Finish 按鈕,創建第 2 個使用 Country Level 的查詢。

創建第 2 個使用 Country Level 的查詢

8) 要爲這個提示頁面添加一個默認值 Canada,在頁面突出顯示 Value Prompt。在頁面底部的左側窗格 Properties 中,選擇 Default Selections 並單擊省略號。這將調用 Default Selections 對話框。

調用 Default Selections 對話框

9) 單擊 Add 按鈕以添加一個新的 Default Selection。

10) 爲 Canada 輸入 Member Unique 名稱。這個示例中的值爲:

[Great_Outdoors_Company].[Sales Territory].[Sales Territory].[Country]-
>:[PC].[@MEMBER].[4]

爲 Canada 輸入 Member Unique 名稱

11) 單擊兩次 OK,關閉 Add 和 Default Selections 對話框。

12) 下圖爲這個 Value Prompt 的 Properties 的概覽。

Value Prompt 的 Properties 的概覽

13) 將報表保存爲 3 Years Product Summary。確保將報表保存在路徑 Public Folders > Great Outdoors Company > Global Filters 中。

14) 運行報表,向下鑽取各行,確保報表能夠成功運行。完成後關閉 Cognos Viewer。

不要關閉 Report Studio,因爲下面的任務將用到它。

2.3 創建一個 Prompt 報表

本小節將創建一個包含單個提示的報表。儘管可以添加多個提示,但單個提示足以展示 Global Filtering 技術。這個報表提供的機制將用於驅動此前創建的 Crosstab 和 Chart 報表中的提示。

1) 創建一個新報表並使用 Blank 模板。

2) 在 Insertable Objects 中單擊 Toolbox 選項卡。

3) 將 Value Prompt 插入 Report Page,而“不是” Prompt Page。

4) 創建一個新參數 pCountry, 並單擊 Next。這個參數的名稱必須匹配此前創建的 Crosstab 和 Chart 報表中使用的參數的名稱。

創建一個新參數 pCountry

5) 在 Create Filter 嚮導頁面上,取消選中 Create a parameterized filter 複選框並單擊 Next 繼續。

選中 Create a parameterized filter 複選框

6) 在 Prompt Wizard — On the Populate control 中,單擊“Value to use:”字段旁邊的省略號。在這個樹中選擇 Great Outdoors Company > Sales Territory > Sales Territory > Country (level) 並單擊 OK。

選擇 Country (level)

7) 單擊 OK 返回到 Prompt Wizard — On the Populate control 對話框。

返回

8) 單擊 Finish 以完成提示創建。

2.3.1 設置提示上的排序和默認值

1) 突出顯示頁面上的 Value Prompt。在左下方窗口的 Properties 窗格的 General 區域中,選擇 Auto-Submit and,並將值從 No 更改爲 Yes。

2) 在 Data 區域下的 Properties 窗格中,找到 Sorting 屬性,然後單擊省略號以更改值。

3) 將 Country 從 Data Items 窗口拖動到 Sort List 窗口,然後單擊 OK 關閉對話框。

拖動到 Sort List 窗口

4) 要爲這個提示頁面添加一個默認值 Canada,突出顯示頁面上的 Value Prompt。在 Properties 窗格中選擇 Default Selections 並單擊省略號。這將調用 Default Selection 對話框。

調用 Default Selection 對話框

5) 單擊 Add 按鈕添加一個新的 Default Selection。

6) 爲 Canada 輸入 Member Unique 名稱。這個示例中的值爲:

[Great_Outdoors_Company].[Sales Territory].[Sales Territory].[Country]-
>:[PC].[@MEMBER].[4]

爲 Canada 輸入 Member Unique 名稱

7) 單擊兩次 OK,關閉 Add 和 Default Selections 對話框。下圖爲這個 Value Prompt 的 Properties 的概覽。

Value Prompt 的 Properties 的概覽

8) 運運行 Report,確保報表正確執行。完成後關閉 Cognos Viewer。

9) 將報表保存爲 Country Prompt。

10) 關閉或最小化 Report Studio。確保將報表存儲在路徑 Public Folders > Great Outdoors Company > Global Filters 中。

2.4 創建門戶頁面

本小節將介紹創建一個包含 3 個 Cognos Viewer portlet 的門戶頁面所需的步驟。這個 Cognos Viewer portlet 將用於顯示在前面的步驟中創建的報表。

1) 在 Cognos Connection 中,導航到文件夾 Public Folders > Great Outdoors Company > Global Filtering。

2) 使用 New Page 按鈕創建一個新頁面。

創建一個新頁面

3) 將這個新頁面命名爲 Global Filtering 並單擊 Next。

4) 爲儀表板佈局選擇兩列。

爲儀表板佈局選擇兩列

5) 將左側列的 Column width 設置爲 20%,將右側列的 Column width 設置爲 80%。

設置各列的百分比

6) 單擊左側列下面的 Add... 鏈接,添加一個新的 portlet。

7) 單擊 Cognos Content 以公開 Cognos Content portlets。

選中 Cognos Viewer portlet 複選框,然後單擊向右箭頭,將這個 portlet 包含到 Selected entries 中。完成後單擊 OK。

將 portlet 包含到 Selected entries 中

8) 在 Set columns and layout 頁面上,單擊右側列下方的 Add... 鏈接。

9) 單擊 Cognos Content 以公開 Cognos Content portlets。

10) 選中 Cognos Viewer portlet 複選框,然後單擊向右箭頭將這個 portlet 包含到 Selected entries 框中。重複上述步驟,將一個 Cognos Navigator portlet 包含到 Selected entries 框中。完成後單擊 OK。

將 Cognos Navigator portlet 包含到 Selected entries 框中

11) 在 Set column and layout 頁面上,單擊 Next 轉到下一個頁面。

12) 輸入 Global Filtering 作爲標題,然後單擊 Next 轉到下一個頁面。

13) 選中兩個複選框 Add page to portal 和 View page,然後單擊 Finish。完成後的頁面應該如下圖所示。

完成並預覽

2.4.1 將 Prompt 報表添加到這個 Viewer 並設置過濾屬性

本小節將介紹將這個 Prompt 報表添加到 Cognos Viewer portlet 所需的步驟。本小節還將展示 portlet 間通信所需的適當設置。

1) 單擊左邊 portlet 的屬性圖標以編輯 portlet 屬性。

2) 單擊 Select an entry,選擇需要包含到這個 portlet 中的報表。

3) 導航到 Public Folders > Great Outdoors Company > Global Filters 並選擇 Country Prompt 報表。

選擇 Country Prompt 報表

4) 在 Property 窗口中的 Entry 區域下面,單擊 Edit properties 打開 Advanced Properties Editor,更改 portlet 之間的 Portlet 通信選項。

更改 portlet 之間的 Portlet 通信選項

5) 將 Fragmentation Action 設置爲 Run the report。

6) 在 Portlet communication options 下,確保選中 Communicate with other portlets 複選框,並保持默認選擇 Portlets not using a channel。

選中 Communicate with other portlets 複選框

7) 完成後單擊 OK,返回 Set the property 頁面。

8) 單擊 OK 以關閉 Set the Property 頁面。您將返回門戶頁面。

2.4.2 將 Crosstab 報表添加到這個 Viewer 並設置過濾和鑽取屬性

本小節將把 Year Product Summary 報表添加到 Cognos Viewer portlet。本小節還將介紹爲過濾、向上和向下鑽取設置適當屬性以支持 portlet 通信所需的步驟。

1) 單擊右上方的 portlet 的屬性圖標,編輯 portlet 屬性。

2) 單擊 Select an entry,選擇要包含到這個 portlet 中的報表。

3) 導航到 Public Folders > Great Outdoors Company > Global Filtering 並選擇 3 Year Product Summary 報表。

選擇 3 Year Product Summary 報表

4) 在 Property 窗口中的 Entry 區域下面,單擊 Edit properties 打開 Advanced Properties Editor,更改 portlet 之間的 Portlet 通信選項。

更改 portlet 之間的 Portlet 通信選項

5) 將 Fragmentation Action 設置爲 Run the report。

6) 在 Portlet communication options 下,

  • 將 Prompt values 設置爲 Communicate with other portlets,並保持默認選擇 Portlets not using a channel。
  • 將 Drill down and drill up 設置爲 Communicate with other portlets on the page, 並保持默認選擇 Portlets not using a channel。

設置 Portlet communication options

7) 完成後單擊 OK,返回 Set the property 頁面。

8) 單擊 OK 以關閉 Set the Property 頁面。您將返回門戶頁面。

2.4.3 將 Chart 報表添加到這個 Viewer 並設置過濾屬性

本小節介紹將 Year Product Contribution 報表添加到這個 Cognos Viewer portlet 所需的步驟。本小節還將介紹如何爲過濾、向上和向下鑽取設置適當屬性以支持 portlet 通信。

1) 單擊右上方的 portlet 的屬性圖標,編輯 portlet 屬性。

2) 單擊 Select an entry,選擇要包含到這個 portlet 中的報表。

3) 導航到 Public Folders > Great Outdoors Company > Global Filtering 並選擇 3 Year Product Contribution 報表。

選擇 3 Year Product Contribution 報表

4) 在 Property 窗口中的 Entry 區域下面,單擊 Edit properties 打開 Advanced Properties Editor,更改 portlet 之間的 Portlet 通信選項。

更改 portlet 之間的 Portlet 通信選項

5) 將 Fragmentation Action 設置爲 Run the report。

6) 在 Portlet communication options 下,

  • 將 Prompt values 設置爲 Communicate with other portlets,並保持默認選擇 Portlets not using a channel。
  • 將 Drill down and drill up 設置爲 Communicate with other portlets on the page, 並保持默認選擇 Portlets not using a channel。

設置 Portlet communication options 1設置 Portlet communication options 2

7) 完成後單擊 OK,返回 Set the property 頁面。

8) 單擊 OK 以關閉 Set the Property 頁面。您將返回門戶頁面。

2.5 測試頁面

2.5.1 測試提示機制

單擊 Country Prompt porlet 上的提示列表中的 Mexico。這個值將傳遞到其他 portlets,每個報表都將使用 Mexico 過濾。

2.5.2 測試鑽取行爲

單擊 3 Year Product Summary 報表上的 Year 2006。這個操作將導致每個報表(3 Year Product Summary 和 3 Year Product Contribution)向下鑽取到 2006 年,並顯示 2006 年的所有季度。

參考資料

學習

獲得產品和技術

  • 在線試用 IBM Cognos BI 試用版軟件,瞭解 IBM Cognos BI 商業智能解決方案的最新版本新功能。
  • 下載 IBM Cognos Express V9 試用版軟件,瞭解 IBM 專爲中型企業定製的集成商業智能和計劃解決方案。
  • 下載免費的 IBM Information Management 試用版軟件,瞭解 IBM Information Management 軟件的最新版本和特性。
  • 獲取更多 IBM 試用版軟件,並熟練掌握來自 DB2®、Lotus®、Tivoli®,以及 WebSphere® 的開發工具和中間件產品,用這些試用版軟件開發您的下一個項目。這些試用版軟件可以免費直接從 developerWorks 下載。

討論

條評論

請 登錄 或 註冊 後發表評論。

注意:評論中不支持 HTML 語法


剩餘 1000 字符

快來添加第一條評論

發佈了16 篇原創文章 · 獲贊 11 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章