Question

I have a table with the following schema.
Dim LocationProductsMapping Table (the key in this table is not used anywhere. It is just a primary key column. )

Key Location            Products    

    XX  A1          P1  
    XX  A2          P2  
    XX  A3          P3  
    XX  A1          P2  
    XX  A3           P2 


* Dim Products (Say P1 , P2 , P3 as keys)
* Dim SellingMode  (Say  S1 , S2 , S3 as keys)
* Dim Shop (Shop1,Shop10,Shop100)

Fact Sales table

 Product    SellingMode Shop    Revenue    

        P1  S1  Shop1    $100

        P1  S2     Shop10   $400

        P1  S1  Shop100    $100

        P1  S3  Shop1      $100

        P2  S2  Shop10    $400

        P1  S1  Shop100   $100

        P3  S3  Shop1     $100

Now I need to build a CUBE.

  1. How should I create a dimension which should include My Location products mapping? (i.e, when I filter by Location, I should only get the following data of the location ).

Output

SellingMode1  $2000 Revenue   20 number of Products
SellingMode2  $3000 Revenue   25 number of products
  1. I tried to create a hierarchy in Dimension like Location,ProductKey. But that doens't help. Values are not proper and filter condition is not applied.

  2. I cannot change the table schema

LocationProductsMapping table is not included in the Datasource view automatically. ( I added this )

I don’t have the Dimension created for “LocationProductsMapping “, (understandable as this is the reference table)

Était-ce utile?

La solution

I am not sure if you have a separate location table. If you have one, build a dimension from it, otherwise use the Location column from the LocationProductsMapping table to build the dimension.

Then create a new measure group from your LocationProductsMapping table. As Analysis Services cannot have measure groups without measures, use the count which the wizard normally suggests. Make this measure invisible, as it is not useful for users. Then on the "Dimension Usage" tab of cube designer, make sure your mapping measure group is related to the Product and Location dimensions, and set the relationship from the main measure group to location to "Many-to-many", selecting the mapping measure group.

And you are done. Analysis Services handles the rest for you.

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