2017-07-14 32 views
0

我有这个这个MDX查询的SSRS数据集,我得到的所有措施,任何线索的空值?在度量上获取NULL

WITH 
MEMBER [Measures].[CA TTC PC] 
as (STRTOMEMBER(@FromAxeTempsTemps2) : STRTOMEMBER(@ToAxeTempsTemps2), 
[Axe Scenario].[Scenario].&[Réalisé] 
, [Measures].[CA TTC]) 
MEMBER [Measures].[CA HT PC] 
as (STRTOMEMBER(@FromAxeTempsTemps2) : STRTOMEMBER(@ToAxeTempsTemps2), 
[Axe Scenario].[Scenario].&[Réalisé] 
, [Measures].[CA HT]) 
MEMBER [Measures].[Marge PC] 
as (STRTOMEMBER(@FromAxeTempsTemps2) : STRTOMEMBER(@ToAxeTempsTemps2), 
[Axe Scenario].[Scenario].&[Réalisé] 
, [Measures].[Marge]) 
MEMBER [Measures].[TauxMarge PC] 
as (STRTOMEMBER(@FromAxeTempsTemps2) : STRTOMEMBER(@ToAxeTempsTemps2), 
[Axe Scenario].[Scenario].&[Réalisé] 
, [Measures].[Taux Marge]) 
MEMBER [Measures].[Quantite Vendue PC] 
as (STRTOMEMBER(@FromAxeTempsTemps2) : STRTOMEMBER(@ToAxeTempsTemps2), 
[Axe Scenario].[Scenario].&[Réalisé] 
, [Measures].[Quantite Vendue]) 
MEMBER [Measures].[Nbr De Tickets PC] 
as (STRTOMEMBER(@FromAxeTempsTemps2) : STRTOMEMBER(@ToAxeTempsTemps2) 
, [Measures].[Nombre De Tickets]) 
SELECT 
{ [Measures].[CA HT], 
[Measures].[CA TTC], 
[Measures].[Marge], [Measures].[Taux Marge] , 
[Measures].[Nombre Tickets],[Measures].[Marge PC] 
, [Measures].[Quantite Vendue], [Measures].[CA TTC PC] , 
    [Measures].[TauxMarge PC] , [Measures].[Quantite Vendue PC] , 
[Measures].[Nbr De Tickets PC] ,[Measures].[Nombre De Tickets] 
,[Measures].[CA HT PC] 
} ON COLUMNS, 
NON EMPTY { (
[Axe Structure Marchandise].[H-Code-SSFamille].[Code Famille].ALLMEMBERS 
* [Axe Structure Marchandise].[H-Libellé-SSFamille].[Famille].ALLMEMBERS 
* [Axe Scenario].[Scenario Id].[Scenario Id].ALLMEMBERS 
* [Axe Date Scénarios].[Aggregation].[Aggregation].ALLMEMBERS 
* [Axe Date Scénarios].[Comparaison].[Comparaison].ALLMEMBERS 
*[Axe Promotion].[Type Vente].[Type Vente].ALLMEMBERS) } 
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME 
ON ROWS FROM (SELECT ({ [Axe Date Scénarios].[Comparaison].&[0]}) 
ON COLUMNS FROM (SELECT ({ [Axe Date Scénarios].[Aggregation].&[0] }) 
ON COLUMNS FROM (SELECT (STRTOSET(@AxeSiteCodeSite)) 
ON COLUMNS 
FROM (SELECT (STRTOSET(@AxeVarianteSensibilite)) 
ON COLUMNS 
FROM (SELECT (STRTOSET(@AxeStructureMarchandiseCodeRayon)) 
ON COLUMNS FROM (SELECT (STRTOSET(@AxeSiteCodeBU, CONSTRAINED)) 
ON COLUMNS FROM (SELECT (STRTOMEMBER(@FromAxeTempsTemps) : STRTOMEMBER(@ToAxeTempsTemps)) 
ON COLUMNS FROM (SELECT ({[Axe Scenario].[Scenario].&[Objectif], [Axe Scenario].[Scenario].&[Réalisé] }) 
ON COLUMNS 
FROM (SELECT (-{[Axe Structure Marchandise].[Libelle Rayon].&[CONSIGNES], [Axe Structure Marchandise].[Libelle Rayon].&[DECONSIGNES]}) 
ON COLUMNS 
FROM (SELECT (-{[Axe Site].[Code Site].&[4], [Axe Site].[Code Site].&[101], [Axe Site].[Code Site].&[137] }) ON COLUMNS 
FROM [DataMartLabelVie])))))))))) 
WHERE (StrToSet(@AxeStructureMarchandiseCodeRayon, CONSTRAINED), 
IIF(STRTOSET(@FromAxeTempsTemps).Count = 1, STRTOSET(@FromAxeTempsTemps), [AxeTemps].[Date].currentmember) 
, IIF(STRTOSET(@AxeSiteCodeBU, CONSTRAINED).Count = 1, 
STRTOSET(@AxeSiteCodeBU, CONSTRAINED), [Axe Site].[Code BU].currentmember)) 
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS 

回答

0

您需要基于复杂的脚本创建一个非常简单的脚本,该脚本不返回空值。 例如从这里开始

SELECT 
    ( 
    -{ 
     [Axe Site].[Code Site].&[4] 
    , [Axe Site].[Code Site].&[101] 
    , [Axe Site].[Code Site].&[137] 
    } 
    ) ON COLUMNS 
FROM [DataMartLabelVie]; 

...请问以上返回空值?希望没有,所以然后添加一些大脚本的复杂性,例如

SELECT 
    ( 
    {[Axe Scenario].[Scenario].&[Objectif], [Axe Scenario].[Scenario].&[Réalisé] } 
) 
ON COLUMNS 
FROM 
(
    SELECT 
    ( 
     -{ 
     [Axe Site].[Code Site].&[4] 
     , [Axe Site].[Code Site].&[101] 
     , [Axe Site].[Code Site].&[137] 
     } 
    ) ON COLUMNS 
    FROM [DataMartLabelVie] 
); 

你现在是否得到了空值 - 不是?好吧增加一些更复杂的..

等,直到你找到问题。