Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Calculated dimension member that sums

$
0
0

I am trying to create a query that will come back with 11 rows:  The top 10 products and the total of all products.  However, I want to *IGNORE* the product with the largest amount (by hardcoding).  So, the total of all products except the best selling and then the top 10 products (againt excepting the best seller).

What I'm struggling with is creating a dimension attribute member that is a sum of all members but the one I want to ignore.  Here's what I've got so far, using AdventureWorks:

WITH
SET [Top10MinusLargest] AS
{TOPCOUNT([Product].[Product].Children - [Product].[Product].&[312]
		 ,10
		 ,[Measures].[Internet Sales Amount])}
MEMBER [Product].[Product].[TotalSalesMinusLargest] AS
({[Product].[Product].Children - [Product].[Product].&[312]}, [Measures].CurrentMember)

SELECT
{[Measures].[Internet Sales Amount]}
ON 0,
NON EMPTY
{
[Product].[Product].[TotalSalesMinusLargest],
[Top10MinusLargest]
}
ON 1
FROM [Adventure Works]

And the results:


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>