我有一个MDX,它使用LEFT获取部门名称的子字符串,如下所示。但是,我需要按substr_dept_name成员对结果进行分组,但对如何实现此目标一无所知。任何帮助表示赞赏。谢谢;
WITH MEMBER [Measures].dummy AS 0
MEMBER [Measures].[revenue] AS SUM(
{revenue_value.[1]},
[Measures].[amount_baseline]
)
MEMBER [Measures].[substr_dept_name] AS (
LEFT(
dept_name.CurrentMember.Name, 2
)
)
SELECT
{[Measures].[revenue],
[Measures].[substr_dept_name]} ON COLUMNS,
SUBSET(
NONEMPTY(
department.[dept_name].CHILDREN,
{[Measures].[revenue]}
),
0,
50
) ON ROWS
FROM
(
SELECT
{ revenue_value.version_id.& [1] } ON 0
FROM
mytable
)