2009-11-23 2 views
0

J'ai la requête suivante qui me donne un extrait (je le mets dans un fichier CSV de mon cube).Besoin d'une colonne Totaux dans MDX

Je souhaite afficher le total de tous les NRx dans une colonne, car la première colonne NRx et le reste des colonnes NRx devraient apparaître comme ils le font maintenant. J'ai essayé d'ajouter un SUM (Measures.NRx) à cela, mais cela n'a pas fonctionné

Comment obtenir une colonne NRx totale?

SELECT 
NON EMPTY 
CrossJoin 
(
    [Time Period].[Calendar].[Cycle Dt], 
    { 
     [Measures].[NRx] 
    } 
) 
ON COLUMNS, 
NON EMPTY 
{(
     [Prescriber].[Prescriber Name].[Prescriber Name].Members 
    , [Prototype Alignment].[Tier Code].[Lilly Tier Code].Members 
    , [Prototype Alignment].[Territory Name].[Territory Name].Members 
    , [Prototype Alignment].[District Name].[District Name].Members 
    , [Prototype Alignment].[Division Name].[Division Name].Members 
    , [Prototype Alignment].[Area Name].[Area Name].Members 
    , [Market Product].[Product Group Nbr].[Product Group Nbr].Members 
    , [Market Product].[Product G Name Name].[Product G Name Name].Members 
)} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
FROM 
( 
    SELECT 
    ({ 
     [Prescriber].[Ims Prescriber Id].&[011111] 
    } 
    , 
    { 
     [Time Period].[Cycle Dt].&[2008-10-03T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-10-10T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-10-17T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-10-24T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-10-31T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-11-07T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-11-14T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-11-21T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-11-28T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-12-05T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-12-12T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-12-12T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-12-19T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-12-26T00:00:00], 
     [Time Period].[Cycle Dt].&[2008-12-26T00:00:00]   
    } 
) ON COLUMNS 
FROM [Mart] 
) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, 
    FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS 

Répondre

2

Dans le premier Crossjoin, où vous avez

[Time Period].[Calendar].[Cycle Dt], 

Essayez d'ajouter une référence au Tout membre de la hiérarchie du calendrier

{[Time Period].[Calendar].[Cycle Dt], [Time Period].[Calendar].[All] }, 
+0

fonctionne parfaitement –

Questions connexes