1

Assuming we have the following dimension

  • DATE
  • CONTRACTOR
  • COLOR
  • SIZE

and a set of 6 measures, we want to get the 6 measures for every Semestrer, Trimester, Month, Contractor, Color and Size for a given Year.

Here is my MDX query:

SELECT 
   { 
         ... the 6 measures ... 
   } ON COLUMNS, 
    { 
          (
                [Dim DATE].[year].[year].AllMembers * 
                [Dim DATE].[SEMESTRE NOM].[SEMESTRE NOM].AllMembers * 
                [Dim DATE].[TRIMESTRE NOM].[TRIMESTRE NOM].AllMembers * 
                [Dim DATE].[MOIS NOM].[MOIS NOM].AllMembers *
                [Dim CONTRACTOR].[Name CONTRACTOR].AllMembers *
                [Dim COLOR].[Name COLOR].AllMembers *
                [Dim SIZE].[Name SIZE].AllMembers 
         ) 
   } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 

 FROM   ( 
   SELECT ( { StrToSet( "[Dim DATE].[year].[year].&[" + @Year + "]" , CONSTRAINED ) }      

   ) ON COLUMNS 
FROM [TheCube]

This is very slow (more than 20 minutes), with only 6 Contractors, 6 Color, 18 sizes... and what is the differences between .AllMembers and .Members ?

4

1 回答 1

1

根据层次结构中的实际年数,您可能会使用交叉连接创建一个相当大的集合。正如评论中提到的icCube,为什么不使用:

StrToSet( "[Dim DATE].[year].[year].&[" + @Year + "]" , CONSTRAINED )

在 ROWS 上的交叉连接中?

所有成员与成员;这是一个文档;allmembers 包括计算。会员;你有任何昂贵的计算吗?会员?

[Dim DATE].[MOIS NOM].[MOIS NOM].AllMembers 中有多少成员?三个月,学期?

于 2012-05-31T09:57:49.997 回答