我是MDX的新手,尝试使用excel(Power Pivot OLAP)创建报告 表格模型立方体。
我需要将DAX表达式下面的内容转换为MDX表达式,
DAX扩展
CALCULATE(
sum('Finance GL'[Value in Origin Currency]),
'Measure Name'[Measure Name] = "GSR",
filter('Customer',Customer[Customer PLTO Level 4 Name]="P3-TH KEY
ACCOUNTS" ||
Customer[Customer PLTO Code]="339883" ||
Customer[Customer PLTO Code]="339801" ||
Customer[Customer PLTO Code]="339879" ||
Customer[Customer PLTO Code]="339899" ||
Customer[Customer PLTO Code]="339830" ||
Customer[Customer PLTO Code]="339878" ||
Customer[Customer PLTO Code]="339928" ||
Customer[Customer PLTO Code]="339929" ))
对于MDX 从多维数据集使用的等效维数和属性如下,
[Measure Name].[Measure Name]=[Measure Name].[Measure Name].&[GSR],
[Customer].[Customer PLTO Level 4 Name]=[Customer].[Customer PLTO Level
4 Name].&[P3-TH KEY ACCOUNTS]
[Customer].[Customer PLTO Code].
[Customer].[Customer PLTO Code].&[339883],
[Customer].[Customer PLTO Code].&[339801],
[Customer].[Customer PLTO Code].&[339879],
[Customer].[Customer PLTO Code].&[339899],
[Customer].[Customer PLTO Code].&[339830],
[Customer].[Customer PLTO Code].&[339878],
[Customer].[Customer PLTO Code].&[339928],
[Customer].[Customer PLTO Code].&[339929]
I have tried to use OR operator in MDX
我在MDX中的方法:
sum(
{
(
[Measure Name].[Measure Name].&[GSR],
[Customer].[Customer PLTO Level 4 Name].&[P3-TH KEY ACCOUNTS],
strtomember("[Customer].[Customer PLTO Code].&[339883]") or
strtomember("[Customer].[Customer PLTO Code].&[339899]")
)
},
[Measures].[Total Value in Origin Currency]
)
但是它抛出无限递归,它被检测为错误消息
请告知我,我们将为您提供任何帮助。
谢谢
关于, 凯达纳斯
答案 0 :(得分:0)
如果我的理解是正确的,则在以下情况下需要“ [度量]。[原始货币总价值]”的总和 1)[度量名称]。[度量名称]。&[GSR]和[客户]。[客户PLTO级别 4名]。&[P3-TH关键帐户]和任何客户PLTO代码 2)[度量名称]。[度量名称]。&[GSR]和客户PLTO代码来自提供的列表以及任何客户PLTO 4级名称。 在MDX中,它将转换为一组的两个元组。并且两个元组都应具有来自相同进位的成员。
基于此查询应如下所示
Sum(
{
([Measure Name].[Measure Name].&[GSR],
[Customer].[Customer PLTO Level 4 Name].&[P3-TH KEY ACCOUNTS],
[Customer].[Customer PLTO Code].[All]),
([Measure Name].[Measure Name].&[GSR],
[Customer].[Customer PLTO Level 4 Name].[All],
{[Customer].[Customer PLTO Code].&[339883],
[Customer].[Customer PLTO Code].&[339801],
[Customer].[Customer PLTO Code].&[339879],
[Customer].[Customer PLTO Code].&[339899],
[Customer].[Customer PLTO Code].&[339830],
[Customer].[Customer PLTO Code].&[339878],
[Customer].[Customer PLTO Code].&[339928],
[Customer].[Customer PLTO Code].&[339929]}
)
},
[Measures].[Total Value in Origin Currency]
)