1

まず最初に、私のキューブの時間ディメンションは、2 つの分離されたディメンションから作成されました。

時間ディメンション: 時間、30 分、10 分、および分のフィールド。

日付ディメンション: 日、月、年フィールド

私の問題は、丸一日ではなく丸一日を探索してフィルタリングしたい場合、丸一日だけを探索したかのように結果が表示されることです。

私が使用しているmdxをお見せしましょう:

select non empty  ([Client].[Client].[Client],[Product].[Product].[Product]) on rows,
  {[Measures].[Example]}  on columns 
from [Cube] 
where ( {([Date].[Id].&[20131002] ) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2059]) } +{([Date].[Id].&[20130930] : [Date].[Id].&[20131001]) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2359]) }  )

日付または時刻のディメンションがないため、その mdx は機能します。

これは機能しません:

select non empty  ([Date].[Date Field].[Date Field]) on rows,
  {[Measures].[Example]}  on columns 
from [Cube] 
where ( {([Date].[Id].&[20131002] ) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2059]) } + {([Date].[Id].&[20130930] : [Date].[Id].&[20131001]) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2359]) }  )

mdx を次のように分割すると、次のようになることに気付きました。

select non empty  ([Date].[Date Field].[Date Field]) on rows,
  {[Measures].[Example]}  on columns 
from [Cube] 
where ( {([Date].[Id].&[20131002] ) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2059]) }  }  

select non empty  ([Date].[Date Field].[Date Field]) on rows,
  {[Measures].[Example]}  on columns 
from [Cube] 
where ( {{([Date].[Id].&[20130930] : [Date].[Id].&[20131001]) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2359]) }  

できます!しかし、私は1つのmdxでそれをやりたい.

誰かが私を助けることができれば、私はとても感謝しています!!

よろしく。

4

1 に答える 1

1

サブセレクトで試すことができます:

select non empty  (EXISTING [Date].[Date Field].[Date Field]) on rows,
  {[Measures].[Example]}  on columns 
from (select 
     ( {([Date].[Id].&[20131002] ) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2059]) } 
     + {([Date].[Id].&[20130930] : [Date].[Id].&[20131001]) *([Time].[Time Field].&[0] : [Time].[Time Field].&[2359]) }  )
      on columns
      from [Cube]
     )

ところで、あなたの MDX は違法です (ただし、Analysis Services は寛容です): MDX 仕様によると、列は select 句の行の前に指定する必要があります。

于 2013-10-11T16:10:00.453 に答える