2016-09-09 16 views
0

このMDXクエリーの全部で非常に新しいです。私は、実行が、次のエラーを取得維持しようとしています次のクエリを持って次のようにSTRTOSET関数は、1つの引数に文字列または数値式が必要です。タプルセット式が使用されました

Executing the query ... Query (19, 16) The STRTOSET function expects a string or numeric expression for the 1 argument. A tuple set expression was used. Execution complete

私のクエリが見えます:あなたはこの機能をstrToSetに文字列を指定する必要があり

SELECT 
NON EMPTY { [Measures].[Effective Duration] } ON COLUMNS, 
NON EMPTY { (
       [Dim Cause Code].[Cause].[Cause].ALLMEMBERS * 
       [Dim Classification].[Classification].[Classification].ALLMEMBERS * 
       [Dim Date 1].[Full Date Alternate Key].[Full Date Alternate Key].ALLMEMBERS * 
       [Dim Location 1].[Work Center Name].[Work Center Name].ALLMEMBERS * 
       [Fact Process Downtime].[Start Datetime].[Start Datetime].ALLMEMBERS * 
       [Fact Process Downtime].[End Datetime].[End Datetime].ALLMEMBERS * 
       [Fact Process Downtime].[Id].[Id].ALLMEMBERS) 
      } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( 
    SELECT (STRTOSET({[Fact Process Downtime].[Is Virtual].&[False]}, CONSTRAINED)) ON COLUMNS 
    FROM ( 
      SELECT (STRTOSET({[Dim Location 1].[Work Center].&[South32 Manganese.Mamatwan.DMS]}, CONSTRAINED)) ON COLUMNS 
      FROM ( 
        SELECT (STRTOSET({[Dim Classification].[Classification].&[Scheduled Process]}, CONSTRAINED)) ON COLUMNS 
        FROM ( 
          SELECT (STRTOSET({[Dim Date 1].[Month Fiscal Year].&[Jul/17]}, CONSTRAINED)) ON COLUMNS FROM [FactDownTime])))) WHERE ( 
    IIF(STRTOSET({[Dim Date 1].[Month Fiscal Year].&[Jul/17]}, CONSTRAINED).Count = 1, STRTOSET({[Dim Date 1].[Month Fiscal Year].&[Jul/17]}, CONSTRAINED), [Dim Date 1].[Month Fiscal Year].currentmember), 
    IIF(STRTOSET(STRTOSET({[Dim Location 1].[Work Center].&[South32 Manganese.Mamatwan.DMS]}, CONSTRAINED).Count = 1, STRTOSET(STRTOSET({[Dim Location 1].[Work Center].&[South32 Manganese.Mamatwan.DMS]}, CONSTRAINED), [Dim Location 1].[Work Center].currentmember), 
    IIF(STRTOSET({[Fact Process Downtime].[Is Virtual].&[False]}, CONSTRAINED).Count = 1, STRTOSET({[Fact Process Downtime].[Is Virtual].&[False]}, CONSTRAINED), [Fact Process Downtime].[Is Virtual].currentmember) 
))) 

答えて

3

は、の略です

https://msdn.microsoft.com/en-us/library/ms144782.aspx

"に設定する文字列は" だから、これは正しくありません。

STRTOSET({[Fact Process Downtime].[Is Virtual].&[False]}, CONSTRAINED) 

しかし、これは正しいです

STRTOSET('{[Fact Process Downtime].[Is Virtual].&[False]}', CONSTRAINED)) 

ので、このような構文はめったに使用されSSRS言うからMDXクエリにパラメータを渡すときstrToSet機能のための主なユースケースは、次のとおりです。

STRTOSET('{[Fact Process Downtime].[Is Virtual].&[False]}', CONSTRAINED)) 

パラメータが関係ない場合は、STRTOSETを取り除くだけです。

{[Fact Process Downtime].[Is Virtual].&[False]} 

あなたはパラメータを使用する必要がある場合は、alejandrozuleta @からこの優れた最新の答えをチェックアウト:

パラメータが重要、あなたのスクリプトは、おそらくこのような何かのように簡略化を取得することができますされていない場合はMDX SSRS Parameter category chooses all sub category

SELECT 
NON EMPTY [Measures].[Effective Duration] ON 0, 
NON EMPTY 
    [Dim Cause Code].[Cause].[Cause].ALLMEMBERS * 
    [Dim Classification].[Classification].[Classification].ALLMEMBERS * 
    [Dim Date 1].[Full Date Alternate Key].[Full Date Alternate Key].ALLMEMBERS * 
    [Dim Location 1].[Work Center Name].[Work Center Name].ALLMEMBERS * 
    [Fact Process Downtime].[Start Datetime].[Start Datetime].ALLMEMBERS * 
    [Fact Process Downtime].[End Datetime].[End Datetime].ALLMEMBERS * 
    [Fact Process Downtime].[Id].[Id].ALLMEMBERS 
    ON 1 
FROM 
( 
    SELECT 
     [Fact Process Downtime].[Is Virtual].&[False] ON 0, 
     [Dim Location 1].[Work Center].&[South32 Manganese.Mamatwan.DMS] ON 1, 
     [Dim Classification].[Classification].&[Scheduled Process] ON 2, 
     [Dim Date 1].[Month Fiscal Year].&[Jul/17] ON 3 
    FROM [FactDownTime] 
); 
+0

ここで質問する前によく尋ねるのはよくある質問で、人はあまり気にしないようです。私の答えを参照していただきありがとうございますが、誰が@mixixですか?彼は彼の答えを削除した? –

+0

@alejandrozuleta apologies - mxixはmdxタグにも投稿しています – whytheq

+0

@alejandro:これは一般的ではありませんが、見出しは同じかもしれませんが、説明は必ずしも探しているものではありません。 –

関連する問題