当 % 符号位于前面时,% 的 MDX format_string 不会乘以 100
对于以下查询:
with
member testVal as 0.1234
member testNormal as testVal
member testPrepend as testVal, format_string="%##.00"
member testMidpend as testVal, format_string="##%.00"
member testAppend as testVal, format_string="##.00%"
select { testNormal, testPrepend, testMidpend, testAppend} on axis (0)
from [SomeRandomPlace]
返回以下内容:
testNormal testPrepend testMidpend testAppend
0.1234 %.12 12%.34 12.34%
这会导致问题,因为我们在 .NET 中使用相同的格式字符串作为后处理操作(某些控制要求我们这样做),并且它的行为符合预期(将其乘以100 因为% 符号)。
这是有记录的行为吗?还是一些不起眼的错误?或者我做错了什么/奇怪的事情?我觉得 testPrepend
成员也应该乘以 100,但事实并非如此。
For the following query:
with
member testVal as 0.1234
member testNormal as testVal
member testPrepend as testVal, format_string="%##.00"
member testMidpend as testVal, format_string="##%.00"
member testAppend as testVal, format_string="##.00%"
select { testNormal, testPrepend, testMidpend, testAppend} on axis (0)
from [SomeRandomPlace]
The following is returned:
testNormal testPrepend testMidpend testAppend
0.1234 %.12 12%.34 12.34%
This is causing issues, as we use the same format string in .NET as a post-process operation (some control requires us to do this), and it behaves as expected (multiplying it by 100 because of the % sign).
Is this documented behaviour? Or some obscure bug? Or am I doing something wrong/weird? I feel the testPrepend
member should also be multiplied by 100, but it's not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
记录的行为似乎暗示您的方法应该有效:http://msdn.microsoft。 com/en-us/library/ms146084.aspx
我已经尝试过使用更大的数字,以确保填充掩码,如果它是第一个字符,它似乎会忽略百分比符号?也许可以通过 MS Connect 提出?
Documented behaviour seems to imply your method should work: http://msdn.microsoft.com/en-us/library/ms146084.aspx
I've tried it with larger numbers, to ensure the mask is filled, it just seems to ignore the percentage symbol if it is the first character? Maybe raise it with MS Connect?