Question

If I run the following some of the resellers are repeated e.g.Sports Products Store - is this as expected?

WITH 
    SET [InitialSet] AS
        EXISTS(
            {[Reseller].[Reseller].[Reseller].MEMBERS},
            { [Date].[Calendar Year].&[2007],
              [Date].[Calendar Year].&[2008] },
            'Reseller Sales'
            )
SELECT 
    {   }
  ON 0,
    [InitialSet]
    ON 1
FROM [Adventure Works]
WHERE (
    [Measures].[Reseller Order Quantity]
    );

So if I use this set with a measure in the following I get two sets of results for Friendly Bike Shop and also for Sports Products Store:

WITH 
    SET [InitialSet] AS
        EXISTS(
            {[Reseller].[Reseller].[Reseller].MEMBERS},
            {[Date].[Calendar Year].&[2007],
             [Date].[Calendar Year].&[2008]},
            'Reseller Sales'
            )
SELECT 
    {
        [Date].[Calendar Year].&[2007],
        [Date].[Calendar Year].&[2008]
    }
  ON 0,
    ORDER(
        [InitialSet]
        ,([Measures].[Reseller Order Quantity],[Date].[Calendar Year].&[2007])
        ,BDESC
    )
    ON 1
FROM [Adventure Works]
WHERE (
    [Measures].[Reseller Order Quantity]
    );
Était-ce utile?

La solution

If you check the details, you will see that e. g. "Friendly Bike Shop" has two different keys: 290 and 643 in the AdventureWorks cube.

And something like this can happen in real life as well: Why would you assume all companies across several countries have different names?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top