saiku之固定維度(必選維度)


工作中遇到的問題,記錄下來方便以后查找。

在saiku中如何設定固定維度?

找到WorkspaceDropZone.js文件,在synchronize_query: function(){}方法中的“var model = this.workspace.query.helper.model();”之前添加如下代碼:

     $(self.workspace.dimension_list.el).find('a').each(function(index,item){
            if(item.text.indexOf("必選")>=0 || item.text.indexOf("Required")>=0){
                if(item.attributes.hasOwnProperty('level') && item.attributes.hasOwnProperty('hierarchy')){
                    self.workspace.query.helper.includeLevel("ROWS",item.attributes.hierarchy.value,item.attributes.level.value);
                }                
            }
        })

這段代碼作用是添加名稱中帶有“必選”兩個字的維度(級別)到queryModel中,所以制作cube的時候固定維度中必須要含有“必選”兩字

其中調用的includeLevel()方法位於SaikuOlapQuery.js文件中,作用是添加level到queryModel

效果圖如下:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM