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

DRILLTHROUGH with EXCEPT clause returning details that should be excluded by the EXCEPT ?

$
0
0

I'm having problems trying to exclude data from the DRILLTHROUGH results. In my scenario, a user wants to mask out some dimension members from their results, then drill through those results. The initial MDX statement correctly excludes totals, etc. from the results, but I can not get drillthrough to honor the EXCEPT clause, even when I try to create a subcube with the filters applied.

A simple contrived example from the AdventureWorks database to illustrate: I want to get the total sales of each product type to non-warehouse resellers:

SELECT { [Measures].[Reseller Sales Amount] } ON Columns,

       { [Product].[Category].[All Products].Children } ON Rows

  FROM ( -- Subselect to exclude Warehouse resellers:

         SELECT { [Measures].[Reseller Sales Amount] } ON Columns,

                { EXCEPT( [Reseller].[Reseller Type].Children,

                          { [Reseller].[Reseller Type].[Business Type].&[Warehouse] }

                        ) } ON Rows

           FROM [Adventure Works]

       )

This gives me the expected results where all of the totals are significantly lower than when not using the subselect to eliminate warehouse sales.

And then when doing the drillthrough:

DRILLTHROUGH

SELECT { [Measures].[Reseller Sales Amount] } ON Columns,

       { [Product].[Category].[Accessories] } ON Rows

  FROM ( -- Subselect to exclude Warehouse resellers:

         SELECT { [Measures].[Reseller Sales Amount] } ON Columns,

                { EXCEPT( [Reseller].[Reseller Type].Children,

                          { [Reseller].[Reseller Type].[Business Type].&[Warehouse] }

                        ) } ON Rows

           FROM [Adventure Works]

       )

RETURN [Reseller Sales].[Reseller Order Quantity],

       [$Employee].[Employee],

       [$Delivery Date].[Date],

       [$Sales Territory].[Sales Territory Region],

       [$Reseller Sales Order Details].[Sales Order Number],

       [$Reseller].[Business Type]

And, the results of the drillthrough include sales to Warehouse resellers. (The same results are seen when defining a subcube that includes the filtering.)

Is it possible to get drillthrough to exclude details for the items that weren't in the totals of the initial query? (I see the same results on SSAS 2008R2 and 2012.)

Thanks,

-MQ



Viewing all articles
Browse latest Browse all 14337

Trending Articles



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