1
votes

I need to create a dimension using another dimension to create some calculated attributes in SSAS to show in excel slicer. But I Don't want to process cube. Only use MDX code to use another dimension and create new dimension to use in slicer.

For example we have a dimension named DimAgeGroup. it has 7 group.

0-10 , 10-20 , ... , 60-70

then i need to create a dimension using mdx to show before 30 and after 30 to show in excel slicer without any cube processing. any idea?

1

1 Answers

1
votes

I think all you want is 2 new calculated members.And calculated members you can deploy without making the cube unprocessed.

CREATE MEMBER [DimAgeGroup].[AgeGroup].[All].[Before 30]
AS
([DimAgeGroup].[AgeGroup].[0-10],[Measures].CURRENTMEMBER]) +
([DimAgeGroup].[AgeGroup].[0-20],[Measures].CURRENTMEMBER])
,VISIBLE =1;

CREATE MEMBER [DimAgeGroup].[AgeGroup].[All].[After 30]
AS
([DimAgeGroup].[AgeGroup].[30-40],[Measures].CURRENTMEMBER])+
([DimAgeGroup].[AgeGroup].[40-50],[Measures].CURRENTMEMBER])+
([DimAgeGroup].[AgeGroup].[50-60],[Measures].CURRENTMEMBER])+
([DimAgeGroup].[AgeGroup].[60-70],[Measures].CURRENTMEMBER])
,VISIBLE =1;

You can deploy either with XMLA or within Visual studio with BIDS Helper (Deploy MDX script feature).

Not so sure about the MDX.. can't test it right now.