![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
_1----1-a--------1-a-x | |--------1-a-y | |--------1-a-z |-----1-c------1-c-f |-----1-d------1-d-f _2----2-b--------2-b-s |---------2-b-t _3----3-a--------3-a-k How should I build my dimension? I dont' manage to get the right |
#2
| |||
| |||
|
|
Hi to all, I'm trying to develop a custom hierarchical dimension from a table with this layout: ID, ID_ATTRIB1,ID_ATTRIB1_ATTRIB2 1, 1-a, 1-a-x 1, 1-a, 1-a-y 1, 1-a, 1-a-z 1, 1-c, 1-c-f 1, 1-d, 1-d-f 2, 2-b, 2-b-s 2, 2-b, 2-b-t 3, 3-a, 3-a-k i'd like to build a dimension in which i can drilldown from the ID attribute, going to the ID__ATTRIB1 attribute and so on to the ID_ATTRIB1_ATTRIB2 attribute, with a result tree like this: |
#3
| |||
| |||
|
|
Hi, is it Analysis 2000? Then just put the table in the Dimensions-Editor. In order of the columns right click on it and select "Insert as Level" (I hope this is the right caption, because I am firm in German AServer). I tried it with Your demodata and it works, hth Bernhard -- CS Result GmbH Bischof-von-Henle-Str. 2 93051 Regensburg "Gabriele!" wrote: Hi to all, I'm trying to develop a custom hierarchical dimension from a table with this layout: ID, ID_ATTRIB1,ID_ATTRIB1_ATTRIB2 1, 1-a, 1-a-x 1, 1-a, 1-a-y 1, 1-a, 1-a-z 1, 1-c, 1-c-f 1, 1-d, 1-d-f 2, 2-b, 2-b-s 2, 2-b, 2-b-t 3, 3-a, 3-a-k i'd like to build a dimension in which i can drilldown from the ID attribute, going to the ID__ATTRIB1 attribute and so on to the ID_ATTRIB1_ATTRIB2 attribute, with a result tree like this: |
#4
| |||
| |||
|
| SQL Server 2005 Books Online |
#5
| |||
| |||
|
|
_1----1-a--------1-a-x 12 | |--------1-a-y 12 | |--------1-a-z 12 |-----1-c------1-c-f 12 |-----1-d------1-d-f 12 _2----2-b--------2-b-s 12 |---------2-b-t 12 _3----3-a--------3-a-k 12 |
|
Hi Gabriele, Make ID_ATTRIB1_ATTRIB2 (assuming it is the leaf level of your hierarchy) the key attribute of the dimension, with ID_ATTRIB1 and ID as the other attributes. Then you can create a user-defined hierarchy: ID->ID_ATTRIB1->ID_ATTRIB1_ATTRIB2 for the dimension, with 3 levels corresponding to the 3 attributes. If this is also a natural hierarchy, you can move the attribute relationship for "ID" from ID_ATTRIB1_ATTRIB2 to ID_ATTRIB1. http://msdn2.microsoft.com/en-us/library/ms174557.aspx SQL Server 2005 Books Online Attribute Relationships .. Natural Hierarchy Relationships A hierarchy is a natural hierarchy when each attribute included in the user-defined hierarchy has a one to many relationship with the attribute immediately below it. .. - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Can you explain how measure1 is defined; what the fact table data looks like for the example you gave; and how it relates to the dimension in question? - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#8
| |||
| |||
|
| SQL Server 2005 Books Online |
#9
| |||
| |||
|
|
-------1-----------7 -------2----------32 -------3----------11 Total--------------50 |
|
-----------1------------------1-a------------------------------ 7 |------------------1-c-------------------------------7 |------------------1-d-------------------------------7 ------------2-----------------2-b------------------------------32 |------------------2-c------------------------------32 |------------------2-e------------------------------32 ------------3-----------------3-a------------------------------11 ------------------3-j------------------------------11 ------------------3-x------------------------------11 Total-------------------------------------------------------------50 |
|
Then maybe the problem lies in how the fact table F is related to the dimension view D - what fields are used to join them, is the dimension relationship regular (see the Dimension Usage tab) and what is the granularity attribute? http://msdn2.microsoft.com/en-us/library/ms365371.aspx SQL Server 2005 Books Online Defining a Regular Relationship and Regular Relationship Properties When you define a new cube dimension or a new measure group, Analysis Services will try to detect if a regular relationship exists and then set the dimension usage setting to Regular. You can view or edit a regular dimension relationship on the Dimension Usage tab of Cube Designer. When you define the relationship of a cube dimension to a measure group, you also specify the granularity attribute for that relationship. The granularity attribute defines the lowest level of detail available in the cube for that dimension, which is generally the key attribute for the dimension. However, sometimes you may want to set the granularity of a particular cube dimension in a particular measure group to a different grain. For example, you may want to set the granularity attribute for the Time dimension to the Month attribute instead of to the Day attribute, if you are using a Sales Quotas or a Budget measure group. When you specify the granularity attribute to be an attribute other than the key attribute, you must guarantee that all other attributes in the dimension are directly or indirectly linked to this other attribute through attribute relationships. If not, Analysis Services will be unable to aggregate data correctly. - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#10
| |||
| |||
|
|
-------1-----------7 -------2----------32 -------3----------11 Total--------------50 |
|
-----------1------------------1-a------------------------------ 7 |------------------1-c-------------------------------7 |------------------1-d-------------------------------7 ------------2-----------------2-b------------------------------32 |------------------2-c------------------------------32 |------------------2-e------------------------------32 ------------3-----------------3-a------------------------------11 ------------------3-j------------------------------11 ------------------3-x------------------------------11 Total-------------------------------------------------------------50 |
|
Then maybe the problem lies in how the fact table F is related to the dimension view D - what fields are used to join them, is the dimension relationship regular (see the Dimension Usage tab) and what is the granularity attribute? http://msdn2.microsoft.com/en-us/library/ms365371.aspx SQL Server 2005 Books Online Defining a Regular Relationship and Regular Relationship Properties When you define a new cube dimension or a new measure group, Analysis Services will try to detect if a regular relationship exists and then set the dimension usage setting to Regular. You can view or edit a regular dimension relationship on the Dimension Usage tab of Cube Designer. When you define the relationship of a cube dimension to a measure group, you also specify the granularity attribute for that relationship. The granularity attribute defines the lowest level of detail available in the cube for that dimension, which is generally the key attribute for the dimension. However, sometimes you may want to set the granularity of a particular cube dimension in a particular measure group to a different grain. For example, you may want to set the granularity attribute for the Time dimension to the Month attribute instead of to the Day attribute, if you are using a Sales Quotas or a Budget measure group. When you specify the granularity attribute to be an attribute other than the key attribute, you must guarantee that all other attributes in the dimension are directly or indirectly linked to this other attribute through attribute relationships. If not, Analysis Services will be unable to aggregate data correctly. - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
![]() |
| Thread Tools | |
| Display Modes | |
| |