2012-01-05 69 views
1

現在我對不同的MDX qry有不同的問題。MDX查詢沒有給出正確答案

對於當月細節我收到上個月還詳細.. 由我使用的MDX查詢:

/* 
SELECT 
NON EMPTY 
    { Hierarchize ({ [Offer].[GrandTotal], [Offer].[GrandTotal].Children }) } 
     ON COLUMNS, 
NON EMPTY 
    { Hierarchize ({ [Circle].[GrandTotal], [Circle].[GrandTotal].Children }) } 
     ON ROWS 
FROM 
    [SCMAircel_ActiveBase] 
WHERE 
    ([Measures].[TotalCount], 
    [Subscriber State].[GrandTotal], 
    [Time].[2012].[${curMonth}].[${curDay}]) 
*/ 

我用兩個參數是給正確的月份和日期值Pentaho報表設計器。但是,下面的例子解釋了這個問題。

我想要circlewise提供一天計數,例如:日期爲2012年4月1日。但是我也得到了上個月同一天的價值..(01-12-2011),因爲這個價值是可用的。但我需要的2012年1月1日的數據僅..

[Subscriber State].[GrandTotal]包含像ACTIVEGRACESUSPEND對此我篩選值,

我不知道怎麼說值TOTAL_COUNT往上加eventhough月份和日期是否正確傳遞....

請告訴任何解決方案,如果有人知道這個

回答

1

我不熟悉的Pentaho但SQL Server分析服務。我假設由於MDX是一個標準,所以不應該有(m)任何差異;)

我假設結果被平化爲2維結果集,並且數據交叉連接並相應地進行交叉連接,然後按報告控件進行分組。

所以,我建議你應該嘗試是(即使它是很難理解您的問題,而無需進一步調查):

/* 
SELECT 
    { 
     // it is best practice to put measures on columns 
     [Measures].[TotalCount] 
    } 
    ON COLUMNS, 
    NON EMPTY 
    { 
     // if you want multiple dimension to be aggregated, you should cross join these 
     Hierarchize ({ [Offer].[GrandTotal], [Offer].[GrandTotal].Children }) } 
     * // cross join here 
     Hierarchize ({ [Circle].[GrandTotal], [Circle].[GrandTotal].Children }) 
    } 
    ON ROWS 
FROM 
    [SCMAircel_ActiveBase] 
WHERE 
    (
    //[Subscriber State].[GrandTotal], // i don't get this. You either need to filter for certain members, or you want members to be crossjoined. But putting a member hierarchy in filter doesn't make sense to me 
    {[Subscriber State].[GrandTotal].[ACTIVE], [Subscriber State].[GrandTotal].[Grace] } // like this for example 
    ,[Time].[2012].[${curMonth}].[${curDay}] 
    ) 
*/ 
+0

嗨克里斯,我所做的更改爲u說。現在它工作很好..謝謝.. – user969084 2012-01-09 14:39:25