![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Amongst others, I have the following dimensions: 1. Distributors 2. Customers 3. Country Both the Distributors and Customers dimensions fields called Regionid, Stateid, and Cityid (I'll refer to these as Geography fields later in this post). As you would probably have figured out these are to be linked with the Country Dimension which has all these fields (Regionid, Stateid, and Cityid) but with more details for each e.g. Name etc. etc. The problem which I am facing (really frustrated becuase of it) is that in the Cube Editor after I have linked the Geography fields of Customers and Distributors with the Geography fields of the Country Dimension and when I try to SAVE the cube, I get a message saying "There is a loop in the schema. Please remove the extra joins". If I delete the Geography links between either the Distributors Dimension and the Country Dimension OR between the Customers Dimension and the Country Dimension OR BOTH, I am then able to save the cube without any problems. Please help. Please let me know if I need to add more information for you to be able to help me solve the problem. Thanks |
#3
| |||
| |||
|
|
Without the specifics of your relational design it is difficult to make a specific recommendation, but I would recommend that you take each dimension and create a view which represents the a star schema format (fully denormalized) for that dimension -- then load Analysis Services from the view. This has several advantages. First, it is always a good best practice, because it separates your physical relational design from your logical star schema. Second, it allows you to fully eliminate loops and other schema issues because in your case you clearly have a strong linkage between dimensions -- something which is typically discouraged (but expected in your design). -- Dave Wickert [MS] dwickert (AT) online (DOT) microsoft.com Program Manager BI Practices Team SQL BI Product Unit (Analysis Services) -- This posting is provided "AS IS" with no warranties, and confers no rights. "Learner" <wantnospam (AT) email (DOT) com> wrote in message Hi, Amongst others, I have the following dimensions: 1. Distributors 2. Customers 3. Country Both the Distributors and Customers dimensions fields called Regionid, Stateid, and Cityid (I'll refer to these as Geography fields later in this post). As you would probably have figured out these are to be linked with the Country Dimension which has all these fields (Regionid, Stateid, and Cityid) but with more details for each e.g. Name etc. etc. The problem which I am facing (really frustrated becuase of it) is that in the Cube Editor after I have linked the Geography fields of Customers and Distributors with the Geography fields of the Country Dimension and when I try to SAVE the cube, I get a message saying "There is a loop in the schema. Please remove the extra joins". If I delete the Geography links between either the Distributors Dimension and the Country Dimension OR between the Customers Dimension and the Country Dimension OR BOTH, I am then able to save the cube without any problems. Please help. Please let me know if I need to add more information for you to be able to help me solve the problem. Thanks |
#4
| |||
| |||
|
|
Dave, Appreciate your reply. Thanks. I am listing down some more details. I'll be very grateful if you can help me solve the problem. The DDLs for my underlying tables is given below along with some IMPORTANT comments (just before the fact tables' DDL): CREATE TABLE [Geography] ( [RedionCode] [int], [RegionName] [nvarchar] (35), [StateCode] [int], [StateName] [nvarchar] (35), [CityCode] [int], [CityName] [nvarchar] (35) ) Comment:Each Distributor has a type and a sub-type CREATE TABLE tblDistributors ( [DistribCode] [nvarchar] (20) , [DistribName] [nvarchar] (50), [DistribTypeCode] [int] , [DistribTypeName] [nvarchar] (50) , [DistribSubTypeCode] [int] , [DistrSubTypeName] [nvarchar] (50) , [DistrRegionCode] [int] , [DistrStateCode] [int] , [DistrCityCode] [int] , ) Comment:Each Customer also has a type and a sub-type CREATE TABLE tblCustomers( [CustCode] [int] (10) , [CustName] [nvarchar] (50) , [CustTypeCode] [int] , [CustTypeName] [nvarchar] (50) , [CustSubTypeCode] [int] , [CustSubTypeName] [nvarchar] (50) , [CustRegionCode] [int] , [CustStateCode] [int] , [CustCityCode] [int] , ) BTW, I also have Time and Products Dimensions and the underlying tables for them but am skipping the details of these... Here's my fact table: Important to note is the business logic that sales are either only to a Distributor or to a Customer BUT via a Distributor i.e. Direct sales to Customers do not happen in the scenario for which I am trying to create my data mart and thus the cube. So my fact table will have records in which the CustomerCode will be NULL... I don't know what problems (if any) will thus make me run into when linking... ![]() CREATE TABLE [SalesFact] ( [ProdCode] [nvarchar] (35), [SaleDate] [datetime], [TotalSaleAmt] [money] [DistributorCode] [nvarchar] (20), [CustomerCode] [int] (10) NULL ) Sorry for the rather lengthy mail but I hope the above details explain the missing information. ALL of my dimensions are Star schema based (including the "derived" one's i.e. Distributor Types and Customer Types) Please guide how I should proceed and what should I do differently in order to solve the problem as well as follow a better design approach. Many thanks in advance. Without the specifics of your relational design it is difficult to make a specific recommendation, but I would recommend that you take each dimension and create a view which represents the a star schema format (fully denormalized) for that dimension -- then load Analysis Services from the view. This has several advantages. First, it is always a good best practice, because it separates your physical relational design from your logical star schema. Second, it allows you to fully eliminate loops and other schema issues because in your case you clearly have a strong linkage between dimensions -- something which is typically discouraged (but expected in your design). -- Dave Wickert [MS] dwickert (AT) online (DOT) microsoft.com Program Manager BI Practices Team SQL BI Product Unit (Analysis Services) -- This posting is provided "AS IS" with no warranties, and confers no rights. "Learner" <wantnospam (AT) email (DOT) com> wrote in message Hi, Amongst others, I have the following dimensions: 1. Distributors 2. Customers 3. Country Both the Distributors and Customers dimensions fields called Regionid, Stateid, and Cityid (I'll refer to these as Geography fields later in this post). As you would probably have figured out these are to be linked with the Country Dimension which has all these fields (Regionid, Stateid, and Cityid) but with more details for each e.g. Name etc. etc. The problem which I am facing (really frustrated becuase of it) is that in the Cube Editor after I have linked the Geography fields of Customers and Distributors with the Geography fields of the Country Dimension and when I try to SAVE the cube, I get a message saying "There is a loop in the schema. Please remove the extra joins". If I delete the Geography links between either the Distributors Dimension and the Country Dimension OR between the Customers Dimension and the Country Dimension OR BOTH, I am then able to save the cube without any problems. Please help. Please let me know if I need to add more information for you to be able to help me solve the problem. Thanks |
#5
| |||
| |||
|
|
2) Since you are using the Geography table to do *name* lookups for city and state, I would create views that hide the join but then expose the names -- I don't see a Geography dimension, but geography levels in the Distributor and Customer dimensions. |
![]() |
| Thread Tools | |
| Display Modes | |
| |