MDX 计算成员 选定成员汇总的总和
我正在尝试编写一个计算成员,它将根据轴上提供的选定值沿维度滚动。
产品->子类别->类别 雷克萨斯->轿车->车 雷克萨斯轿跑车 ->轿跑车->车 宝马->轿车->车 宝马轿跑车 ->情侣->车 福特->拾取 ->卡车 雪佛兰->拾取 ->卡车 福特 suv ->越野车->卡车 林肯导航 ->越野车->卡车
[计算的测量值] = [测量值].[a]+[测量值].[b]
假设用户希望在汽车级别查看雷克萨斯轿跑车和宝马的[计算的测量值]。如何创建一个计算度量,该度量将根据维度中选择的内容在汽车级别上汇总?
先感谢您!
I'm trying to write a calculated member that will roll up along a dimension based on the selected values provided on the axes.
Product -> subcategory -> category
lexus -> sedan -> car
lexus-coupe -> coupe -> car
bmw -> sedan -> car
bmw-coupe -> couple -> car
ford -> pickup -> truck
chev -> pickup -> truck
ford-suv -> suv -> truck
lincoln-nav -> suv -> truck
[Calculated measure] = [measures].[a]+[measures].[b]
suppose the user wants to see [Calculated measure] at the car level for just lexus-coupe and bmw. How do you create a calculated measure that will roll up at the car level based on what has been selected in the dimension?
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我之前编写过 MDX 来检查行(或列)上使用的维度并更改度量的计算方式。有点乱。
此示例查看轴 1(行?)是否正在使用任何度量,并且可以相应地更改计算:
不记得为什么我先执行 StrToSet,然后执行 SetToStr,但它有效!
您可以使用 VBA 字符串函数(如
InStr()
)来检查用户在行和列上选择的内容,并相应地调整计算的成员...I have previously written MDX to check what dimensions are being used on rows (or columns) and change the way a measure is being calculated. It is a bit messy.
This example looks to see if axis 1 (rows?) is using any Measures, and can change the calculation accordingly:
Can't remember why I did StrToSet and then SetToStr, but it worked!
You may be able to use VBA string functions like
InStr()
to examine what the user has selected on rows and columns, and fiddle with your calculated members accordingly...