`

Pentaho Ctools Table显示交叉表

 
阅读更多

Pentaho的CDE显示交叉表格

 

原来以为Table Component只能显示二维表格,但是在《Learning Pentaho CTools(PACKT,2016).pdf》看到交叉表(第6单元)

 

 

.

MDX:

WITH
MEMBER [Measures].[Trend] as IIF(ISEMPTY(([Time].CURRENTMEMBER.lag(1), 
[Measures].[Sales])) OR [Measures].[Sales]=0, 0, ([Measures].[Sales]-
([Time].CURRENTMEMBER.lag(1), [Measures].[Sales])) /[Measures].
[Sales])+0
MEMBER [Measures].[Sales ($)] as [Measures].[Sales]+0
MEMBER [Measures].[Qt] as [Measures].[Quantity]+0
SELECT
NON EMPTY CrossJoin({[Markets].[Territory].Members}, {[Measures].[Qt], [Measures].[Sales ($)], [Measures].
[Trend]}) ON COLUMNS,
NON EMPTY {[Product].[Product].Members} ON ROWS
FROM [SteelWheelsSales]
Where [Time].[2004]

 

Table Component

.

Post Execution

 

function f() {
    var cells = $( "#" + this.htmlObject + " thead th" );
    
    
    
    var level = "1";
    cells.each(function(i, v) {
        if( i > 0 ) { //skip the first cell of each row
            var cell = $( v );
            var originalText = cell.text();
            var originalTextParts = originalText.split( "/" );
            // cell.text( originalTextParts[1] ); //write the second part (the mobile company in your case)
            
            if(originalTextParts.length>1) {
                level = originalTextParts.length-1;
            }
        }
    });
    
    var idx;
    for (idx = 0; idx < level; idx++) {
        var newHeaderRow1 = "<tr><th></th>";
        var text=''
        var text_length=1
        cells.each(function(i, v) {
            if( i > 0 ) { //skip the first cell of each row
                var cell = $( v );
                var originalText = cell.text();
                var originalTextParts = originalText.split( "/" );
                // cell.text( originalTextParts[1] ); //write the second part (the mobile company in your case)
                

                if(originalTextParts.length==1) {
                    newHeaderRow1+="<th></th>"
                } else if(originalTextParts.length>1) {
                    if(text!=originalTextParts[idx]) {
                        if(text === '') {
                            text=originalTextParts[idx]
                        } else {
                            newHeaderRow1+=("<th valign='middle' align='center' colspan='"+text_length+"'>"+text+"</th>")
                            text_length=1
                            text=originalTextParts[idx]
                        }
                    } else {
                        text_length++;
                        if((cells.length-1) == i) {
                            newHeaderRow1+=("<th valign='middle' align='center' colspan='"+text_length+"'>"+text+"</th>")
                            text_length=1
                            text=originalTextParts[idx]
                        }
                    }
                }
            }
        });
        newHeaderRow1+="</tr>"
        $( "#" + this.htmlObject + " thead" ).prepend( newHeaderRow1 );
    }
    
    
    cells.each(function(i, v) {
        if( i > 0 ) { //skip the first cell of each row
            var cell = $( v );
            var originalText = cell.text();
            var originalTextParts = originalText.split( "/" );
            cell.text( originalTextParts[1] ); //write the second part (the mobile company in your case)
        }
    });
    
    
    var newHeaderRow = "<tr><th></th><th colspan='4'>Latenza Media</th><th colspan='4'>Through. Download Medio</th></tr>";
    // $( "#" + this.htmlObject + " thead" ).prepend( newHeaderRow );

    //add some style...
    $( "#" + this.htmlObject + " thead th" ).css( "border", "1px solid #DEDEDE" ).css( "background", "#F9F9F9" );
    $( "#" + this.htmlObject + " thead th:eq(0)" ).css( "border", "0px solid #DEDEDE" ).css( "background", "#FFFFFF" ); //hide first cell
} 
 

 

.

分享到:
评论

相关推荐

    Learning Pentaho CTools Color Images

    Learning Pentaho CTools Color Images Learning Pentaho CTools Color Images pentaho数据可视化 CTools 套件学习 使用书籍

    learning-pentaho-ctools

    learning-pentaho-ctoolslearning-pentaho-ctoolslearning-pentaho-ctoolslearning-pentaho-ctoolslearning-pentaho-ctoolslearning-pentaho-ctoolslearning-pentaho-ctools

    Learning Pentaho CTools(2016)(随书代码)

    Being an introductory chapter Chapter 1, Getting Started with CTools andChapter 9: Pentaho App Builder, Chapter 10, Embed, Deploy, and Debugdoes not contain code files. Chapter 1, Getting Started ...

    Learning Pentaho CTools(PACKT,2016)

    Pentaho and CTools are two of the fastest and most rapidly growing tools for practical solutions not found in any other tool available on the market. Using Pentaho allows you to build a complete ...

    Learning Pentaho CTools.pdf

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, ...

    Learning-Pentaho-CTools:Packt Publishing学习Pentaho CTools

    作为介绍性章节,第1章,CTools入门和第9章:Pentaho App Builder,第10章,嵌入,部署和调试不包含代码文件。 第1章“ CTools入门”简要介绍了CTools的历史。 它还将向您介绍该工具的用途,并教您安装社区工具...

    kettle资料6本

    1:Learning Pentaho CTools(PACKT,2016).pdf 2:Pentaho Data Integration Beginner's Guide, Second Edition.pdf 3:Packt.Pentaho for Big Data Analytics.2013.pdf 4:pentaho kettle solutions.pdf 5:[Packt ...

    pentaho kettle中文开发手册

    用户可以学习到如何创建、编辑和运行步骤(Step),如数据库连接、表输入、表输出、过滤、转换等,以及如何进行错误处理和日志记录。 《eteenterprisejava.pdf》可能涉及与Java企业级应用相关的知识,虽然不是直接...

    pentaho经典中文资料

    Pentaho是一款开源的企业级商业智能(BI)平台,它提供了数据集成、数据分析和报表等多种功能。这个压缩包中包含的是一系列经典的中文资料,涵盖了Pentaho的不同方面,旨在帮助用户深入理解和使用Pentaho。 1. **...

    pentaho-kettle-8.2.zip

    Pentaho Kettle是一款强大的ETL(提取、转换、加载)工具,由Pentaho公司开发。这个名为“pentaho-kettle-8.2.zip”的压缩包文件包含了Pentaho Data Integration(Kettle)的第8.2版本。Pentaho Kettle通过图形化的...

    Pentaho cde整合Birt

    【标题】:“Pentaho CDE 整合 Birt” 【描述】: Pentaho CDE(Component Development Environment)是Pentaho BI平台中的一个工具,用于构建交互式的Web仪表板。它允许开发者通过拖放的方式创建数据可视化应用,...

    pentaho4.8汉化总结

    完成上述步骤后,重启Pentaho BI Server,系统界面应显示为中文。然而,值得注意的是,汉化过程中可能会遇到一些隐藏的或特定场景下的英文文本,这需要深入代码或使用调试工具进行查找和修改。此外,保持对Pentaho...

    pentaho初学中文文档

    【Pentaho初学中文文档】是一份针对Pentaho初学者整理的指南,涵盖了Pentaho BI Server的安装、使用以及Report Designer和Design Studio的基础操作。以下是对这些知识点的详细说明: 一、BI Server安装及用法 1. BI...

    pentaho-aggdesigner-algorithm-5.1.5-jhyde-API文档-中文版.zip

    赠送jar包:pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar; 赠送原API文档:pentaho-aggdesigner-algorithm-5.1.5-jhyde-javadoc.jar; 赠送源代码:pentaho-aggdesigner-algorithm-5.1.5-jhyde-sources.jar; ...

    pentaho教程

    用户可以通过这个工具设计各种类型的报表,包括表格、交叉表、图表等,支持自定义样式和布局。报表可以基于多种数据源,如SQL查询、XML文件或Pentaho Data Integration的结果集。Pentaho的报表设计注重灵活性和可...

    Pentaho-8-Reporting-for-Java-Developers-master_Pentaho-8-Reporti

    Pentaho 报表开发是Java开发者在数据可视化和商业智能领域中的一个重要工具。Pentaho 8 是一个功能强大的开源套件,包含了数据集成、报表设计、数据分析等多个组件,为企业的数据处理提供全面的解决方案。在这个名为...

    Pentaho Reporting(2014)

    Pentaho Reporting是开源商业智能(BI)套件Pentaho的一部分,主要负责数据报表和分析的生成。2014年版本的Pentaho Reporting在当时是一个重要的里程碑,提供了丰富的功能和改进,使得用户能够更好地从大数据源中...

    Pentaho Solutions

    Pentaho Solutions Pentaho Solutions

    pentaho BI oracle执行脚本

    - `create_quartz_ora.sql`:Quartz是Pentaho BI中的一个任务调度框架,这个脚本可能用于创建与Quartz相关的表和触发器,以实现定时任务和工作流自动化。 - `create_repository_ora.sql`:此脚本可能是用来创建...

    创建 Pentaho Solutions 中文

    在本文中,我们将深入探讨如何创建Pentaho解决方案,这是一个强大的商业智能(BI)平台,它提供了数据集成、分析和报告等关键功能。Pentaho以其用户友好的界面和可扩展性而闻名,使得企业能够构建定制化的BI解决方案...

Global site tag (gtag.js) - Google Analytics