【问题标题】:IcCube - displaying row numbers in icCube TableIcCube - 在 icCube 表中显示行号
【发布时间】:2020-07-22 20:40:13
【问题描述】:

在 Google Table 中有一个选项可以显示行号。但不幸的是,在其他表格中,此选项不可用。我们不使用 Google Table,因为 IcCube Table 只是在处理大量数据时渲染速度更快。

我们了解到的一种解决方法是创建一个具有常量值的计算度量,例如:Row as 42,然后设置一个自定义渲染器,如下所示:

function(context) {
    return "<span>"+context.getRowIndex()+"</span>";
}

很遗憾,如果导出表格,则会显示常量值(即 42)而不是行号。

有没有一种有用的方法来获取 icCube 中其他表中的行号?

【问题讨论】:

    标签: mdx iccube iccube-reporting


    【解决方案1】:

    一种可能性是使用计算成员来获取行号(它不适用于向下钻取)。

    假设您有两个轴,查询将如下所示:

    WITH
       FUNCTION _currentTuple(_t) as CASE _t.count
                WHEN 1 THEN _t.hierarchy.currentMember
                WHEN 2 THEN ( _t.Item(0).hierarchy.currentMember,_t.Item(1).hierarchy.currentMember)
                // you get the idea 
                ELSE  Error( "_currentTuple- " + Str(_t.count)  )
               END
       MEMBER [Line Position] as Rank( _currentTuple( Axis(1)(0) )  ,   Axis(1) )
    SELECT
     [Line Position] on 0,
     [Customers].[Geography].[Region].members * [Product].[Product].[Category] on 1
    FROM [Sales]   
    

    这让我们认为我们应该添加一个函数来以更简单的方式获取当前轴成员。

    _希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-27
      • 1970-01-01
      • 2015-04-01
      • 2023-03-21
      相关资源
      最近更新 更多