MDX #2 – Top (n) Products Sales in each Sales Territory

To get top (n) products with highest sales in every sales territory, the GENERATE function is exactly what we need which applies a set to each member of another set.

	{[Measures].[Reseller Sales Amount]} ON Columns,
		[Sales Territory].[Sales Territory].[Country].MEMBERS
		,TOPCOUNT([Sales Territory].[Sales Territory].CURRENTMEMBER
			,[Measures].[Reseller Sales Amount]
FROM [Adventure Works]


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s