Cube 緯度分析
Cube的效果如何,需要通過緯度表的大小來判斷,系統自帶有一隻程式去分析,但是每次會把系統所有的Cube都分析一遍,結果也不好找。 所以稍微修改了一下。
程式前提: Cube 執行一次“資料庫統計”, 在Cube 的管理頁面,有一個效能標籤頁,在那裡可以執行此操作。
REPORT ZR_INFOCUBE_DESIGNS .
******************************************************************************
*todo: analyse the dimension table , compare the result to fact table
*modi: Robin Lei
*date: 2013.7.18
*******************************************************************************
TYPE-POOLS: RSD, RSDU.
DATA: L_T_CUBE TYPE RSD_T_CUBE,
L_S_CUBE TYPE RSD_S_CUBE,
L_FACTROWS TYPE I,
L_S_TABLSIZE TYPE RSDU_S_TABLSIZE,
L_T_TABLSIZE TYPE RSDU_T_TABLSIZE,
L_DENSITY TYPE F,
L_PDENSITY TYPE P DECIMALS 1,
L_COUNTER TYPE I,
L_ODD TYPE I.
PARAMETERS:L_CUBE TYPE RSINFOCUBE.
* get list of all active infocubes in the system
CALL FUNCTION 'RSD_CUBE_MULTI_GET_ONLY_DB'
EXPORTING
I_READ_ALL = RS_C_TRUE
* I_T_INFOCUBE =
I_OBJVERS = RS_C_OBJVERS-ACTIVE
* I_CUBETYPE = 'B'
* I_T_CUBETYPE =
* I_WITH_ATR_NAV = RS_C_FALSE
IMPORTING
E_T_CUBE = L_T_CUBE
* E_T_CUBE_IOBJ =
* E_T_DIME_IOBJ =
* E_T_IC_VAL_IOBJ =
EXCEPTIONS
ILLEGAL_INPUT = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* loop over the cubes and get information
L_COUNTER = 0.
LOOP AT L_T_CUBE INTO L_S_CUBE WHERE INFOCUBE = L_CUBE .
* get cube layout information
CALL FUNCTION 'RSDU_INFOCUBE_TABLE_SIZES'
EXPORTING
I_INFOCUBE = L_S_CUBE-INFOCUBE
I_CHECK = RS_C_TRUE
IMPORTING
E_FACTROWS = L_FACTROWS
E_T_TABLSIZE = L_T_TABLSIZE
E_DENSITY = L_DENSITY.
* give details only for non-empty cubes
IF L_FACTROWS = 0. CONTINUE. ENDIF.
* count non-empty cubes
L_COUNTER = L_COUNTER + 1.
* set format
FORMAT COLOR COL_BACKGROUND INVERSE ON.
* print cube infos
L_PDENSITY = L_DENSITY.
WRITE: AT / L_S_CUBE-INFOCUBE,
AT 20 'rows:', L_FACTROWS,
AT 40 'density:', L_PDENSITY, '%'.
* print cube table infos
LOOP AT L_T_TABLSIZE INTO L_S_TABLSIZE.
* swap formats
L_ODD = L_COUNTER MOD 2.
IF L_ODD = 1.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF INVERSE OFF.
ELSE.
FORMAT COLOR COL_BACKGROUND INTENSIFIED ON INVERSE OFF.
ENDIF.
* write ...
IF L_S_TABLSIZE-SIZE_CHECK <> RSDU_C_CHECK-GREEN.
FORMAT COLOR COL_NEGATIVE INTENSIFIED OFF INVERSE ON.
ENDIF.
WRITE: AT / L_S_CUBE-INFOCUBE,
AT 20 L_S_TABLSIZE-TABLNM,
AT 40 'rows:', L_S_TABLSIZE-ROWS,
AT 60 'ratio:', L_S_TABLSIZE-PERCENT, '%'.
ENDLOOP.
ENDLOOP.
IF SY-SUBRC NE 0.
WRITE: L_CUBE ,'NOT EXIST!'.
ENDIF.
******************************************************************************
*todo: analyse the dimension table , compare the result to fact table
*modi: Robin Lei
*date: 2013.7.18
*******************************************************************************
TYPE-POOLS: RSD, RSDU.
DATA: L_T_CUBE TYPE RSD_T_CUBE,
L_S_CUBE TYPE RSD_S_CUBE,
L_FACTROWS TYPE I,
L_S_TABLSIZE TYPE RSDU_S_TABLSIZE,
L_T_TABLSIZE TYPE RSDU_T_TABLSIZE,
L_DENSITY TYPE F,
L_PDENSITY TYPE P DECIMALS 1,
L_COUNTER TYPE I,
L_ODD TYPE I.
PARAMETERS:L_CUBE TYPE RSINFOCUBE.
* get list of all active infocubes in the system
CALL FUNCTION 'RSD_CUBE_MULTI_GET_ONLY_DB'
EXPORTING
I_READ_ALL = RS_C_TRUE
* I_T_INFOCUBE =
I_OBJVERS = RS_C_OBJVERS-ACTIVE
* I_CUBETYPE = 'B'
* I_T_CUBETYPE =
* I_WITH_ATR_NAV = RS_C_FALSE
IMPORTING
E_T_CUBE = L_T_CUBE
* E_T_CUBE_IOBJ =
* E_T_DIME_IOBJ =
* E_T_IC_VAL_IOBJ =
EXCEPTIONS
ILLEGAL_INPUT = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* loop over the cubes and get information
L_COUNTER = 0.
LOOP AT L_T_CUBE INTO L_S_CUBE WHERE INFOCUBE = L_CUBE .
* get cube layout information
CALL FUNCTION 'RSDU_INFOCUBE_TABLE_SIZES'
EXPORTING
I_INFOCUBE = L_S_CUBE-INFOCUBE
I_CHECK = RS_C_TRUE
IMPORTING
E_FACTROWS = L_FACTROWS
E_T_TABLSIZE = L_T_TABLSIZE
E_DENSITY = L_DENSITY.
* give details only for non-empty cubes
IF L_FACTROWS = 0. CONTINUE. ENDIF.
* count non-empty cubes
L_COUNTER = L_COUNTER + 1.
* set format
FORMAT COLOR COL_BACKGROUND INVERSE ON.
* print cube infos
L_PDENSITY = L_DENSITY.
WRITE: AT / L_S_CUBE-INFOCUBE,
AT 20 'rows:', L_FACTROWS,
AT 40 'density:', L_PDENSITY, '%'.
* print cube table infos
LOOP AT L_T_TABLSIZE INTO L_S_TABLSIZE.
* swap formats
L_ODD = L_COUNTER MOD 2.
IF L_ODD = 1.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF INVERSE OFF.
ELSE.
FORMAT COLOR COL_BACKGROUND INTENSIFIED ON INVERSE OFF.
ENDIF.
* write ...
IF L_S_TABLSIZE-SIZE_CHECK <> RSDU_C_CHECK-GREEN.
FORMAT COLOR COL_NEGATIVE INTENSIFIED OFF INVERSE ON.
ENDIF.
WRITE: AT / L_S_CUBE-INFOCUBE,
AT 20 L_S_TABLSIZE-TABLNM,
AT 40 'rows:', L_S_TABLSIZE-ROWS,
AT 60 'ratio:', L_S_TABLSIZE-PERCENT, '%'.
ENDLOOP.
ENDLOOP.
IF SY-SUBRC NE 0.
WRITE: L_CUBE ,'NOT EXIST!'.
ENDIF.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/554557/viewspace-766643/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 常用經緯度轉換為ntu經緯度
- 經緯度轉換
- SAP BW:CUBE size 分析
- 米轉換經緯度
- 全國城市經緯度資料
- 分析函式rollup||cube學習函式
- 分析函式 - CUBE和GROUPING SETS函式
- java百度地圖介面呼叫獲取經緯度Java地圖
- java 根據兩個位置的經緯度,來計算兩地的距離 經緯度處理Java
- .NET程式獲取當前IP經緯度,並透過經緯度實現天氣查詢功能
- 高德解析城市的分析,根據高德的經緯度獲取城市cityCode
- 中國所有省市區的ip經緯度介面
- java 根據經緯度計算圓周Java
- 經緯度互換和計算距離
- Spark2 Dataset多維度統計cube與rollupSpark
- 百度地圖根據經緯度計算瓦片行列號地圖
- [Developer] CubeDeveloper
- iOS中地圖經緯度座標轉換iOS地圖
- 使用google map v3新增經緯度資訊Go
- JAVA計算兩經緯度間的距離Java
- 如何快速將地址解析為經緯度座標?
- 【CUBE】Oracle分組函式之CUBE魅力Oracle函式
- C#根據經緯度獲取實體地址C#
- 驗證經緯度格式正規表示式程式碼
- 緯度在系統報表中的運用方式
- ConvertLatOrLonFilter-經緯度格式轉換-保留6位Filter
- Cesium 滑鼠拾取橢球、地形、模型座標點(經度+緯度+高程)模型
- java 經緯度處理、計算兩地的距離、獲取當前一定距離以內的經緯度值Java
- 根據經緯度座標查詢最近的門店
- 經緯度編碼方法推薦-pluscode簡介
- 根據時間經緯度高程計算天頂角
- 智慧手環WIFI熱點和經緯度API獲取WiFiAPI
- 透過經緯度計算距離獲取附近商家
- js根據經緯度,獲取省市區。(百度地圖逆地址解析)JS地圖
- Java根據地理位置獲取經緯度(呼叫百度地圖API)Java地圖API
- 呼叫百度api透過經緯度獲取實際地理位置資訊API
- Cube 技術解讀 | Cube 小程式技術詳解
- Cube 技術解讀 | Cube 渲染設計的前世今生