代码之家  ›  专栏  ›  技术社区  ›  Espo

MDX中计算度量值的舍入

  •  4
  • Espo  · 技术社区  · 16 年前

    在服务器上没有Excel的情况下,如何将计算的MDX度量值四舍五入到最接近的整数?Excel函数是 CEILING(number, significance) ,但无法在生产SSAS服务器上安装Excel。

    2 回复  |  直到 7 年前
        1
  •  6
  •   Magnus Smith    16 年前

    如果这是Microsoft的情况,您可以使用MDX中的任何VBA函数来处理字符串或数字。所以 Round(xxxxxx, 2) 会起作用。

        2
  •  0
  •   Igor Krupitsky    7 年前

    对于floor函数,尝试int函数如下:

    Int([Measures].[Store Sales])
    

    对于天花板功能,尝试int+1

    IIF(([Measures].[Store Sales]) - Int([Measures].[Store Sales]) = 0, [Measures].[Store Sales], Int([Measures].[Store Sales]) + 1)