dbTalk Databases Forums  

Re: Problems representing M:N relations in dimensions

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Re: Problems representing M:N relations in dimensions in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jéjé
 
Posts: n/a

Default Re: Problems representing M:N relations in dimensions - 03-12-2006 , 08:55 AM






its a normal behavior, if you tell AS to use 2 times the same client, AS
will use 2 times the same client data in the cube!

sperate your dimension into 2 dimensions
the first is the statistics the second is the client dimension

another option is to create a composite key like StatisticID + '-' +
ClientID and use this key at the lowest level of the dimension.
in this case the combination stat / client will be unique
you have to create the same formula in your fact table to be able to link
the fact to the dimension.


"Olaia Vázquez" <olaia (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello

I have a problem in representing dimensions with N:M relations with the
Fact_table.

I am going to try to explain it properly:

I have 1 dimension call Statistics with 3 levels:
Statistics_Type
Statistic_Value
Cient

An example of the values in this dimension is the following:
Country Statistic
Spain
Client1
Client3
Portugal
Client2
Sector Statistic
Industry
Client1
Education
Client2

As you can see, the clients are repeated in different tree leafs.

If I create a fact_table in which I use the client code I am going to have
problems with repeated values.

I use SQL Server 2000 and I can not modify origin tables.

The number of levels (statistics types) is variable so I can not split
this
dimension in one dimension for each statistics type.

I would thank any help with this problem,

Olaia Vázquez.




Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: Problems representing M:N relations in dimensions - 03-12-2006 , 10:17 AM






oohhh ok.

create 2 hierarchies in the "Client dimension"
the first one will be "Clients by country" the second "Clients by Sector"
to do this, create a view on the client table and create the second
hierarchy using this table (a simple select * from ... is enough)

or you can create 1 dimension based on the most requested hierarchy "Client
by country", add a property at the client level "Sector" and create a
virtual dimension based on this property "Sectors" (final: 2 dimensions, 1
for the clients/country the second is the sectors)


"Olaia Vázquez" <olaia (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thank you for answering.

I think that I didn't explain properly my problem. I want to put only one
time the data in the fact_table, but I want to analyze it in different
ways
depending on the statistic type. For example, I have in the fact_table the
sales for each client:

Client Sales
Client1 100
Client2 200
Client3 300

I want to analyze the sales for each statistic type:

Country Statistic
Spain 400
Client1 100
Client3 300
Portugal 200
Client2 200

Sector Statistic
Industry 100
Client1 100
Education 200
Client2 200

I know that this architecture is not the most correct, I would like to put
each statistic in one dimension but the problem is that the number of
statistics is variable (it depends on the data in one table) and I need to
find the way to represent all of them.

Olaia Vázquez.



"Jéjé" wrote:

its a normal behavior, if you tell AS to use 2 times the same client, AS
will use 2 times the same client data in the cube!

sperate your dimension into 2 dimensions
the first is the statistics the second is the client dimension

another option is to create a composite key like StatisticID + '-' +
ClientID and use this key at the lowest level of the dimension.
in this case the combination stat / client will be unique
you have to create the same formula in your fact table to be able to link
the fact to the dimension.


"Olaia Vázquez" <olaia (AT) discussions (DOT) microsoft.com> wrote in message
news:0AAA59FC-7EC7-42DE-AB9C-AF486E9F8AE8 (AT) microsoft (DOT) com...
Hello

I have a problem in representing dimensions with N:M relations with the
Fact_table.

I am going to try to explain it properly:

I have 1 dimension call Statistics with 3 levels:
Statistics_Type
Statistic_Value
Cient

An example of the values in this dimension is the following:
Country Statistic
Spain
Client1
Client3
Portugal
Client2
Sector Statistic
Industry
Client1
Education
Client2

As you can see, the clients are repeated in different tree leafs.

If I create a fact_table in which I use the client code I am going to
have
problems with repeated values.

I use SQL Server 2000 and I can not modify origin tables.

The number of levels (statistics types) is variable so I can not split
this
dimension in one dimension for each statistics type.

I would thank any help with this problem,

Olaia Vázquez.







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.