Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

in Top 10 with two dimension i need to add others in my MDX query

$
0
0

Hi this is code working fine and return top 2  product in a  state. i need to add other sales also how can we do

with set FIPS as [Geography].[State-Province].[State-Province]
set TCat as

Generate( {FIPS}, CrossJoin( {[Geography].[State-Province].CurrentMember},
TOPCount(
         ([Product].[Subcategory].[Subcategory]),
         2,
         [Measures].[Sales Amount]
       ) ))



SELECT { [Measures].[Sales Amount] } ON COLUMNS,
TCat  ON ROWS
FROM [Adventure Works]

  



hi fond one code it is work for one dimension only, i need for two dimension

WITH
SET [TCat] AS
TopCount([Product].[Subcategory].[Subcategory],10,[Measures].[Sales Amount])


MEMBER [Product].[Subcategory].[Other] AS
Aggregate([Product].[Subcategory].[Subcategory] - TCat)


SELECT { [Measures].[Sales Amount] } ON COLUMNS,
TCat + [Other] ON ROWS
FROM [Adventure Works]
;


Viewing all articles
Browse latest Browse all 14337

Trending Articles