Search code examples
sql-serverssasbusiness-intelligenceolap-cube

MS Analysis Cube - one-to-many joins


I am building an OLAP cube in MS SQL Server BI Studio. I have two main tables that contain my measures and dimensions.

One table contains

Date | Keywords | Measure1 

where date-keyword is the composite key.

One table contains looks like

Date | Keyword | Product | Measure2 | Measure3 

where date-keyword-product is the composite key.

My problem is that there can be a one-to-many relationship between date-keyword's in the first table and date-keyword's in the second table (as the second table has data broken down by product).

I want to be able to make queries that look something like this when filtered for a given Keyword:

                                Measure1    Measure2    Measure3
============================================================
Tuesday, January 01 2013        23          19          18
============================================================
    Bike                        23
    Car                         23          16          13
    Motorcycle                  23                          
    Caravan                     23          2           4   
    Van                         23          1           1

I've created dimensions for the Date and ProductType but I'm having problems creating the dimension for the Keywords. I can create a Keyword dimension that affects the measures from the second table but not the first.

Can anyone point me to any good tutorials for doing this sort of thing?


Solution

  • Turns out the first table had one row with all null values (a weird side effect of uploading an excel file straight into MS SQL Server db). Because the value that the cube was trying to apply the dimension to was null in this one row, the whole cube build and deploy failed with no useful error messages! Grr