有什么方法可以在浏览 SSAS 立方体时控制小数位数吗?
当我浏览多维数据集并按月份透视 Sales 时(例如),我得到类似 12345.678901 的信息。
有没有办法让用户浏览时得到的值四舍五入到最接近的两位小数,即:12345.68?
谢谢,
-泰迪
When I browse the cube and pivot Sales by Month ,(for example), I get something like 12345.678901.
Is there a way to make it so that when a user browses they get values rounded up to nearest two decimal places, ie: 12345.68, instead?
Thanks,
-teddy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以在度量或计算的属性中输入格式字符串,如果您的 OLAP 客户端支持,则将使用该格式。例如,对于 1 位小数,您可以使用“#,0.0;(#,0.0)”之类的内容。 Excel 默认支持格式字符串,您可以配置 Reporting Services 以使用它们。
此外,如果您正在处理金钱,则应该将度量配置为使用货币数据类型。默认情况下,如果数据库中的源数据类型为 Money,Analysis Services 将使用 Double。这可能会引入舍入问题,并且不如使用货币有效。有关详细信息,请参阅本文:货币数据类型的诸多好处。使用货币的另一个好处是您永远不会看到超过 4 位小数。
You can enter a format string in the properties for your measure or calculation and if your OLAP client supports it then the formatting will be used. e.g. for 1 decimal place you'd use something like "#,0.0;(#,0.0)". Excel supports format strings by default and you can configure Reporting Services to use them.
Also if you're dealing with money you should configure the measure to use the Currency data type. By default Analysis Services will use Double if the source data type in the database is Money. This can introduce rounding issues and is not as efficient as using Currency. See this article for more info: The many benefits of money data type. One side benefit of using Currency is you will never see more than 4 decimal places.
编辑多维数据集本身的显示属性,因此每当有人编辑多维数据集时,它总是返回 2 位小数。
或者您可以在运行 MDX 时添加格式字符串:
Either edit the display properties in the cube itself, so it always returns 2 decimal places whenever anyone edits the cube.
Or you can add in a format string when running MDX:
您可以更改度量的格式字符串属性。有两种可能的方法:
如果测量是直接测量 -
<块引用>
<块引用>
转到度量的属性并更新“格式字符串”
如果测量是计算测量 -
<块引用>
<块引用>
转到计算并更新“格式字符串”
You can change format string property of your measure. There are two possible ways:
If measure is direct measure -
If measure is calculated measure -