Sqlserver
 sql >> Base de données >  >> RDS >> Sqlserver

MDX Comment calculer une mesure par rapport à une dimension sans afficher les membres dans les résultats

WITH MEMBER [Measures].[A] AS
   [Measures].[Internet Order Count] + [Measures].[Reseller Order Count]
SELECT
{ [Measures].[Internet Order Count], [Measures].[A] } ON COLUMNS,
 [Date].[Calendar].[Month] ON ROWS
 FROM (
   SELECT { [Measures].[Internet Order Count] } ON COLUMNS,
   Filter (
     Filter ( [Date].[Calendar].[Month] * [Delivery Date].[Calendar].[Month], [Date].[Calendar].CurrentMember.Name = [Delivery Date].[Calendar].CurrentMember.Name ) * [Sales Territory].[Sales Territory Country].[Sales Territory Country],
     [Measures].[Internet Order Count] + [Measures].[Reseller Order Count] > 100
   ) ON ROWS
   FROM [Adventure Works]
 )
WHERE [Date].[Calendar Year].[CY 2008]