简体   繁体   English

在MDX中舍入计算的度量

[英]Rounding of calculated measure in MDX

How can i round a calculated mdx measure up to the nearest integer without having Excel on the server? 如何在服务器上没有Excel的情况下将计算出的mdx度量舍入到最接近的整数? The Excel-function is CEILING(number, significance) , but it is not possible to install Excel on the production ssas-server. Excel函数是CEILING(number, significance) ,但无法在生产ssas-server上安装Excel。

If this is a Microsoft situation, you can use any VBA functions in your MDX to fiddle with strings or numbers. 如果这是Microsoft的情况,您可以使用MDX中的任何VBA函数来摆弄字符串或数字。 So Round(xxxxxx, 2) would work. 所以Round(xxxxxx, 2)会起作用。

For the Floor function try Int function like: 对于Floor函数,尝试Int函数,如:

Int([Measures].[Store Sales])

For the Ceiling function try Int + 1 对于Ceiling函数,请尝试Int + 1

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM