dbTalk Databases Forums  

AMO Example for DegenerateMeasureGroupDimension

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


Discuss AMO Example for DegenerateMeasureGroupDimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Acius
 
Posts: n/a

Default AMO Example for DegenerateMeasureGroupDimension - 11-15-2005 , 02:01 AM






I'm trying to add a measure group dimension with a relationship type of fact.
It looks like this is a
DegenerateMeasureGroupDimension

I've added it with AMO and the results look OK.
It doesn't show up the same was as a manually created one in the cube
dimension usage panel.
It's saying "a fact dimension has been created in a way the user interface
does not support".

Is there an AMO Example for DegenerateMeasureGroupDimension

Reply With Quote
  #2  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: AMO Example for DegenerateMeasureGroupDimension - 11-15-2005 , 08:45 PM






Hi,

Currently I did not find and sample code for
DegenerateMeasureGroupDimension class. Will you provide the code you use to
create this dimension? I will try to reproduce the issue on my side.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Quote:
Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
thread-index: AcXpurjdfK9S3nt4QWqOIGGNXghepw==
X-WBNR-Posting-Host: 203.202.23.100
From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
Subject: AMO Example for DegenerateMeasureGroupDimension
Date: Tue, 15 Nov 2005 00:01:02 -0800
Lines: 11
Message-ID: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64475
X-Tomcat-NG: microsoft.public.sqlserver.olap

I'm trying to add a measure group dimension with a relationship type of
fact.
It looks like this is a
DegenerateMeasureGroupDimension

I've added it with AMO and the results look OK.
It doesn't show up the same was as a manually created one in the cube
dimension usage panel.
It's saying "a fact dimension has been created in a way the user
interface
does not support".

Is there an AMO Example for DegenerateMeasureGroupDimension



Reply With Quote
  #3  
Old   
Acius
 
Posts: n/a

Default RE: AMO Example for DegenerateMeasureGroupDimension - 11-16-2005 , 01:32 AM



Hi,

it's generic code (driven for metadata stored in tables)
Let me know if the following isn't enough

'Dimension may have already been added when processing another
measure group
'If the dimension is already there use it
Try

objCubeDim = objCube.Dimensions.FindByName(strDimName)
If objCubeDim Is Nothing Then
'Add Dimension to the Cube
objCubeDim = objCube.Dimensions.Add(objDim.ID)
objCubeDim.Name = strDimName
End If
Catch ex As Exception
FlagError("Failed CreateCubeDimension. Can't Add " & strDim, "Y")
Return
End Try
Try
' Have to create appropriate object based on relationship type
If strRelationshipType = "Fact" Then
'Fact relationship so use DegenerateMeasureGroupDimension
Dim objMGFactDim As New DegenerateMeasureGroupDimension
objMGFactDim.CubeDimensionID = objCubeDim.ID
' add to the measure group
objMeasureGroup.Dimensions.Add(objMGFactDim)
objMGA = objMGFactDim.Attributes.Add(objDim.KeyAttribute.ID )
objMGA.Type = MeasureGroupAttributeType.Granularity
'Add Key
objMGA.KeyColumns.Add(strMeasureGroupTable,
strMeasureGroupKey, OleDbType.WChar)
Else


"Peter Yang [MSFT]" wrote:

Quote:
Hi,

Currently I did not find and sample code for
DegenerateMeasureGroupDimension class. Will you provide the code you use to
create this dimension? I will try to reproduce the issue on my side.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| thread-index: AcXpurjdfK9S3nt4QWqOIGGNXghepw==
| X-WBNR-Posting-Host: 203.202.23.100
| From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| Subject: AMO Example for DegenerateMeasureGroupDimension
| Date: Tue, 15 Nov 2005 00:01:02 -0800
| Lines: 11
| Message-ID: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64475
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| I'm trying to add a measure group dimension with a relationship type of
fact.
| It looks like this is a
| DegenerateMeasureGroupDimension
|
| I've added it with AMO and the results look OK.
| It doesn't show up the same was as a manually created one in the cube
| dimension usage panel.
| It's saying "a fact dimension has been created in a way the user
interface
| does not support".
|
| Is there an AMO Example for DegenerateMeasureGroupDimension
|



Reply With Quote
  #4  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: AMO Example for DegenerateMeasureGroupDimension - 11-17-2005 , 04:49 AM



Hi,

I was not able to use the code to createa Degenerate Measure Group
Dimension at present. I will perform some more research and get back ASAP.

Also, I suggest that you right click the manully created fact
dimension->Script demension as->Create to->New query editor Window and
check attributes of the dimension you need. Thanks.

Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Quote:
Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
thread-index: AcXqf9Xpt84enCBHTCeJF49+/4duIw==
X-WBNR-Posting-Host: 203.202.23.100
From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
Subject: RE: AMO Example for DegenerateMeasureGroupDimension
Date: Tue, 15 Nov 2005 23:32:02 -0800
Lines: 99
Message-ID: <4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F (AT) microsoft (DOT) com
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64525
X-Tomcat-NG: microsoft.public.sqlserver.olap

Hi,

it's generic code (driven for metadata stored in tables)
Let me know if the following isn't enough

'Dimension may have already been added when processing another
measure group
'If the dimension is already there use it
Try

objCubeDim = objCube.Dimensions.FindByName(strDimName)
If objCubeDim Is Nothing Then
'Add Dimension to the Cube
objCubeDim = objCube.Dimensions.Add(objDim.ID)
objCubeDim.Name = strDimName
End If
Catch ex As Exception
FlagError("Failed CreateCubeDimension. Can't Add " & strDim,
"Y")
Return
End Try
Try
' Have to create appropriate object based on relationship type
If strRelationshipType = "Fact" Then
'Fact relationship so use DegenerateMeasureGroupDimension
Dim objMGFactDim As New DegenerateMeasureGroupDimension
objMGFactDim.CubeDimensionID = objCubeDim.ID
' add to the measure group
objMeasureGroup.Dimensions.Add(objMGFactDim)
objMGA =
objMGFactDim.Attributes.Add(objDim.KeyAttribute.ID )
objMGA.Type = MeasureGroupAttributeType.Granularity
'Add Key
objMGA.KeyColumns.Add(strMeasureGroupTable,
strMeasureGroupKey, OleDbType.WChar)
Else


"Peter Yang [MSFT]" wrote:

Hi,

Currently I did not find and sample code for
DegenerateMeasureGroupDimension class. Will you provide the code you
use to
create this dimension? I will try to reproduce the issue on my side.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader
so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
| Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| thread-index: AcXpurjdfK9S3nt4QWqOIGGNXghepw==
| X-WBNR-Posting-Host: 203.202.23.100
| From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| Subject: AMO Example for DegenerateMeasureGroupDimension
| Date: Tue, 15 Nov 2005 00:01:02 -0800
| Lines: 11
| Message-ID: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64475
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| I'm trying to add a measure group dimension with a relationship type
of
fact.
| It looks like this is a
| DegenerateMeasureGroupDimension
|
| I've added it with AMO and the results look OK.
| It doesn't show up the same was as a manually created one in the cube
| dimension usage panel.
| It's saying "a fact dimension has been created in a way the user
interface
| does not support".
|
| Is there an AMO Example for DegenerateMeasureGroupDimension
|





Reply With Quote
  #5  
Old   
Acius
 
Posts: n/a

Default RE: AMO Example for DegenerateMeasureGroupDimension - 11-17-2005 , 08:24 PM



Hi,

Did you mean
right-click on right-click on the measure group?
If so the XML looks the same for the manually created
DegenerateMeasureGroupDimension and the one generated through AMO. I assume
this means it works OK (looks like it is) but Business Intelligence
Development Studio isn't handling something created with AMO?

Thanks

"Peter Yang [MSFT]" wrote:

Quote:
Hi,

I was not able to use the code to createa Degenerate Measure Group
Dimension at present. I will perform some more research and get back ASAP.

Also, I suggest that you right click the manully created fact
dimension->Script demension as->Create to->New query editor Window and
check attributes of the dimension you need. Thanks.

Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| thread-index: AcXqf9Xpt84enCBHTCeJF49+/4duIw==
| X-WBNR-Posting-Host: 203.202.23.100
| From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
| Subject: RE: AMO Example for DegenerateMeasureGroupDimension
| Date: Tue, 15 Nov 2005 23:32:02 -0800
| Lines: 99
| Message-ID: <4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F (AT) microsoft (DOT) com
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64525
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| Hi,
|
| it's generic code (driven for metadata stored in tables)
| Let me know if the following isn't enough
|
| 'Dimension may have already been added when processing another
| measure group
| 'If the dimension is already there use it
| Try
|
| objCubeDim = objCube.Dimensions.FindByName(strDimName)
| If objCubeDim Is Nothing Then
| 'Add Dimension to the Cube
| objCubeDim = objCube.Dimensions.Add(objDim.ID)
| objCubeDim.Name = strDimName
| End If
| Catch ex As Exception
| FlagError("Failed CreateCubeDimension. Can't Add " & strDim,
"Y")
| Return
| End Try
| Try
| ' Have to create appropriate object based on relationship type
| If strRelationshipType = "Fact" Then
| 'Fact relationship so use DegenerateMeasureGroupDimension
| Dim objMGFactDim As New DegenerateMeasureGroupDimension
| objMGFactDim.CubeDimensionID = objCubeDim.ID
| ' add to the measure group
| objMeasureGroup.Dimensions.Add(objMGFactDim)
| objMGA =
objMGFactDim.Attributes.Add(objDim.KeyAttribute.ID )
| objMGA.Type = MeasureGroupAttributeType.Granularity
| 'Add Key
| objMGA.KeyColumns.Add(strMeasureGroupTable,
| strMeasureGroupKey, OleDbType.WChar)
| Else
|
|
| "Peter Yang [MSFT]" wrote:
|
| > Hi,
|
| > Currently I did not find and sample code for
| > DegenerateMeasureGroupDimension class. Will you provide the code you
use to
| > create this dimension? I will try to reproduce the issue on my side.
|
| > Best Regards,
|
| > Peter Yang
| > MCSE2000/2003, MCSA, MCDBA
| > Microsoft Online Partner Support
|
| > When responding to posts, please "Reply to Group" via your newsreader
so
| > that others may learn and benefit from your issue.
|
| > ================================================== ===
|
|
|
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
|
| > --------------------
| > | Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| > | thread-index: AcXpurjdfK9S3nt4QWqOIGGNXghepw==
| > | X-WBNR-Posting-Host: 203.202.23.100
| > | From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| > | Subject: AMO Example for DegenerateMeasureGroupDimension
| > | Date: Tue, 15 Nov 2005 00:01:02 -0800
| > | Lines: 11
| > | Message-ID: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.olap
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64475
| > | X-Tomcat-NG: microsoft.public.sqlserver.olap
| > |
| > | I'm trying to add a measure group dimension with a relationship type
of
| > fact.
| > | It looks like this is a
| > | DegenerateMeasureGroupDimension
| > |
| > | I've added it with AMO and the results look OK.
| > | It doesn't show up the same was as a manually created one in the cube
| > | dimension usage panel.
| > | It's saying "a fact dimension has been created in a way the user
| > interface
| > | does not support".
| > |
| > | Is there an AMO Example for DegenerateMeasureGroupDimension
| > |
|
|
|



Reply With Quote
  #6  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: AMO Example for DegenerateMeasureGroupDimension - 11-21-2005 , 12:27 AM



Hi,

Thank you for your patience. Based on the feedback from product team. This
error message "a fact dimension has been created in a way the user
interface does not support".happens when the table of the dimension is not
the same with the dimension of the measure group, or when the granularity
attribute is not the key attribute of the dimension. You may want to check
this to see if it helps. Have a great day!

Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Quote:
Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
thread-index: AcXr5ybsuzSplOzQREefbpCHCc+uKA==
X-WBNR-Posting-Host: 203.202.23.100
From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
<4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F (AT) microsoft (DOT) com>
<nMKiiS26FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl>
Quote:
Subject: RE: AMO Example for DegenerateMeasureGroupDimension
Date: Thu, 17 Nov 2005 18:24:07 -0800
Lines: 170
Message-ID: <2B911DF7-36E8-4521-BC24-E97322D7AE44 (AT) microsoft (DOT) com
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.olap
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64607
X-Tomcat-NG: microsoft.public.sqlserver.olap

Hi,

Did you mean
right-click on right-click on the measure group?
If so the XML looks the same for the manually created
DegenerateMeasureGroupDimension and the one generated through AMO. I
assume
this means it works OK (looks like it is) but Business Intelligence
Development Studio isn't handling something created with AMO?

Thanks

"Peter Yang [MSFT]" wrote:

Hi,

I was not able to use the code to createa Degenerate Measure Group
Dimension at present. I will perform some more research and get back
ASAP.

Also, I suggest that you right click the manully created fact
dimension->Script demension as->Create to->New query editor Window and
check attributes of the dimension you need. Thanks.

Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader
so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
| Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| thread-index: AcXqf9Xpt84enCBHTCeJF49+/4duIw==
| X-WBNR-Posting-Host: 203.202.23.100
| From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
| Subject: RE: AMO Example for DegenerateMeasureGroupDimension
| Date: Tue, 15 Nov 2005 23:32:02 -0800
| Lines: 99
| Message-ID: <4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F (AT) microsoft (DOT) com
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64525
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| Hi,
|
| it's generic code (driven for metadata stored in tables)
| Let me know if the following isn't enough
|
| 'Dimension may have already been added when processing
another
| measure group
| 'If the dimension is already there use it
| Try
|
| objCubeDim = objCube.Dimensions.FindByName(strDimName)
| If objCubeDim Is Nothing Then
| 'Add Dimension to the Cube
| objCubeDim = objCube.Dimensions.Add(objDim.ID)
| objCubeDim.Name = strDimName
| End If
| Catch ex As Exception
| FlagError("Failed CreateCubeDimension. Can't Add " &
strDim,
"Y")
| Return
| End Try
| Try
| ' Have to create appropriate object based on relationship
type
| If strRelationshipType = "Fact" Then
| 'Fact relationship so use
DegenerateMeasureGroupDimension
| Dim objMGFactDim As New
DegenerateMeasureGroupDimension
| objMGFactDim.CubeDimensionID = objCubeDim.ID
| ' add to the measure group
| objMeasureGroup.Dimensions.Add(objMGFactDim)
| objMGA =
objMGFactDim.Attributes.Add(objDim.KeyAttribute.ID )
| objMGA.Type = MeasureGroupAttributeType.Granularity
| 'Add Key
| objMGA.KeyColumns.Add(strMeasureGroupTable,
| strMeasureGroupKey, OleDbType.WChar)
| Else
|
|
| "Peter Yang [MSFT]" wrote:
|
| > Hi,
|
| > Currently I did not find and sample code for
| > DegenerateMeasureGroupDimension class. Will you provide the code
you
use to
| > create this dimension? I will try to reproduce the issue on my
side.
|
| > Best Regards,
|
| > Peter Yang
| > MCSE2000/2003, MCSA, MCDBA
| > Microsoft Online Partner Support
|
| > When responding to posts, please "Reply to Group" via your
newsreader
so
| > that others may learn and benefit from your issue.
|
| > ================================================== ===
|
|
|
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
|
| > --------------------
| > | Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| > | thread-index: AcXpurjdfK9S3nt4QWqOIGGNXghepw==
| > | X-WBNR-Posting-Host: 203.202.23.100
| > | From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| > | Subject: AMO Example for DegenerateMeasureGroupDimension
| > | Date: Tue, 15 Nov 2005 00:01:02 -0800
| > | Lines: 11
| > | Message-ID: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.olap
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64475
| > | X-Tomcat-NG: microsoft.public.sqlserver.olap
| > |
| > | I'm trying to add a measure group dimension with a relationship
type
of
| > fact.
| > | It looks like this is a
| > | DegenerateMeasureGroupDimension
| > |
| > | I've added it with AMO and the results look OK.
| > | It doesn't show up the same was as a manually created one in the
cube
| > | dimension usage panel.
| > | It's saying "a fact dimension has been created in a way the user
| > interface
| > | does not support".
| > |
| > | Is there an AMO Example for DegenerateMeasureGroupDimension
| > |
|
|
|





Reply With Quote
  #7  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: AMO Example for DegenerateMeasureGroupDimension - 11-22-2005 , 03:00 AM



Hi,

The following code is for just for your reference and there is no warranty.

Dimensions dimension = cubeDimension.Dimension;
DegenerateMeasureGroupDimension msrGrpDim =new
DegenerateMeasureGroupDimension();
msrGrpDim.CubeDimensionID = cubeDimension.ID;

MeasureGroupAttribute mgrGrpAttr=new
MeasureGroupAttribute(dimension.KeyAttribute.ID);
mgrGrpAttr.Type=MeasureGroupAttributeType.Granular ity;
foreach (DataItem dataItem in dimension.KeyAttribute.KeyColumns)
{
DataItem dataItemOfMsrgGrpAttr = new DataItem();
CopyDataItem(dataItem, dataItemOfMsrgGrpAttr);
mgrGrpAttr.KeyColumns.Add(dataItemOfMsrgGrpAttr);
}

msrGrpDim.Attributes.Add(mgrGrpAttr);

measureGroup.Dimensions.Add(msrGrpDim);

/// <summary>
/// Method is used in creation of bindings for measure group attributes.
/// The goal is to keep in sync the type and size of the bindings between
/// key column bindings of the dimension attribute and key column bindings
/// of the measure group attribute.
/// </summary>
/// <param name="dataItemSrc">Source data item. Normally the one from the
attribute key columns.</param>
/// <param name="dataItemDst">Destination data item. Normally the one to be
stored in measure group attribute key columns.</param>
/// <param name="copyNullProcessing">If true then NullProcessing is copied.
Otherwise it is not copied.</param>
public static void CopyDataItem(DataItem dataItemSrc, DataItem dataItemDst,
bool copyNullProcessing)
{
NullProcessing nullProcessing = copyNullProcessing ?
dataItemSrc.NullProcessing : dataItemDst.NullProcessing;
dataItemSrc.CopyTo(dataItemDst);
dataItemDst.NullProcessing = nullProcessing;
}

public static void CopyDataItem(DataItem dataItemSrc, DataItem dataItemDst)
{
CopyDataItem(dataItemSrc, dataItemDst, true);
}


Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Quote:
X-Tomcat-ID: 98719403
References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
<4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F (AT) microsoft (DOT) com>
<nMKiiS26FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl>
<2B911DF7-36E8-4521-BC24-E97322D7AE44 (AT) microsoft (DOT) com>
Quote:
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: petery (AT) online (DOT) microsoft.com (Peter Yang [MSFT])
Organization: Microsoft
Date: Mon, 21 Nov 2005 06:27:16 GMT
Subject: RE: AMO Example for DegenerateMeasureGroupDimension
X-Tomcat-NG: microsoft.public.sqlserver.olap
Message-ID: <cbdfkSm7FHA.128 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
Newsgroups: microsoft.public.sqlserver.olap
Lines: 220
Path: TK2MSFTNGXA02.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64677
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi,

Thank you for your patience. Based on the feedback from product team.
This
error message "a fact dimension has been created in a way the user
interface does not support".happens when the table of the dimension is
not
the same with the dimension of the measure group, or when the granularity
attribute is not the key attribute of the dimension. You may want to
check
this to see if it helps. Have a great day!

Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

================================================== ===



This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
| Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| thread-index: AcXr5ybsuzSplOzQREefbpCHCc+uKA==
| X-WBNR-Posting-Host: 203.202.23.100
| From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F...soft (DOT) com
nMKiiS26FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
| Subject: RE: AMO Example for DegenerateMeasureGroupDimension
| Date: Thu, 17 Nov 2005 18:24:07 -0800
| Lines: 170
| Message-ID: <2B911DF7-36E8-4521-BC24-E97322D7AE44 (AT) microsoft (DOT) com
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64607
| X-Tomcat-NG: microsoft.public.sqlserver.olap
|
| Hi,
|
| Did you mean
| right-click on right-click on the measure group?
| If so the XML looks the same for the manually created
| DegenerateMeasureGroupDimension and the one generated through AMO. I
assume
| this means it works OK (looks like it is) but Business Intelligence
| Development Studio isn't handling something created with AMO?
|
| Thanks
|
| "Peter Yang [MSFT]" wrote:
|
| > Hi,
|
| > I was not able to use the code to createa Degenerate Measure Group
| > Dimension at present. I will perform some more research and get back
ASAP.
|
| > Also, I suggest that you right click the manully created fact
| > dimension->Script demension as->Create to->New query editor Window
and
| > check attributes of the dimension you need. Thanks.
|
| > Regards,
|
| > Peter Yang
| > MCSE2000/2003, MCSA, MCDBA
| > Microsoft Online Partner Support
|
| > When responding to posts, please "Reply to Group" via your newsreader
so
| > that others may learn and benefit from your issue.
|
| > ================================================== ===
|
|
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
|
| > --------------------
| > | Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| > | thread-index: AcXqf9Xpt84enCBHTCeJF49+/4duIw==
| > | X-WBNR-Posting-Host: 203.202.23.100
| > | From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| > | References: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
| > <NFfgbfl6FHA.832 (AT) TK2MSFTNGXA02 (DOT) phx.gbl
| > | Subject: RE: AMO Example for DegenerateMeasureGroupDimension
| > | Date: Tue, 15 Nov 2005 23:32:02 -0800
| > | Lines: 99
| > | Message-ID: <4FCCCDA1-6BCC-40B0-A4A5-0C270599BB1F (AT) microsoft (DOT) com
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.olap
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.olap:64525
| > | X-Tomcat-NG: microsoft.public.sqlserver.olap
| > |
| > | Hi,
| > |
| > | it's generic code (driven for metadata stored in tables)
| > | Let me know if the following isn't enough
| > |
| > | 'Dimension may have already been added when processing
another
| > | measure group
| > | 'If the dimension is already there use it
| > | Try
| > |
| > | objCubeDim = objCube.Dimensions.FindByName(strDimName)
| > | If objCubeDim Is Nothing Then
| > | 'Add Dimension to the Cube
| > | objCubeDim = objCube.Dimensions.Add(objDim.ID)
| > | objCubeDim.Name = strDimName
| > | End If
| > | Catch ex As Exception
| > | FlagError("Failed CreateCubeDimension. Can't Add " &
strDim,
| > "Y")
| > | Return
| > | End Try
| > | Try
| > | ' Have to create appropriate object based on
relationship
type
| > | If strRelationshipType = "Fact" Then
| > | 'Fact relationship so use
DegenerateMeasureGroupDimension
| > | Dim objMGFactDim As New
DegenerateMeasureGroupDimension
| > | objMGFactDim.CubeDimensionID = objCubeDim.ID
| > | ' add to the measure group
| > | objMeasureGroup.Dimensions.Add(objMGFactDim)
| > | objMGA =
| > objMGFactDim.Attributes.Add(objDim.KeyAttribute.ID )
| > | objMGA.Type = MeasureGroupAttributeType.Granularity
| > | 'Add Key
| > | objMGA.KeyColumns.Add(strMeasureGroupTable,
| > | strMeasureGroupKey, OleDbType.WChar)
| > | Else
| > |
| > |
| > | "Peter Yang [MSFT]" wrote:
| > |
| > | > Hi,
| > |
| > | > Currently I did not find and sample code for
| > | > DegenerateMeasureGroupDimension class. Will you provide the code
you
| > use to
| > | > create this dimension? I will try to reproduce the issue on my
side.
| > |
| > | > Best Regards,
| > |
| > | > Peter Yang
| > | > MCSE2000/2003, MCSA, MCDBA
| > | > Microsoft Online Partner Support
| > |
| > | > When responding to posts, please "Reply to Group" via your
newsreader
| > so
| > | > that others may learn and benefit from your issue.
| > |
| > | > ================================================== ===
| > |
| > |
| > |
| > | > This posting is provided "AS IS" with no warranties, and confers
no
| > rights.
| > |
| > | > --------------------
| > | > | Thread-Topic: AMO Example for DegenerateMeasureGroupDimension
| > | > | thread-index: AcXpurjdfK9S3nt4QWqOIGGNXghepw==
| > | > | X-WBNR-Posting-Host: 203.202.23.100
| > | > | From: "=?Utf-8?B?QWNpdXM=?=" <acius (AT) nospam (DOT) nospam
| > | > | Subject: AMO Example for DegenerateMeasureGroupDimension
| > | > | Date: Tue, 15 Nov 2005 00:01:02 -0800
| > | > | Lines: 11
| > | > | Message-ID: <74386462-146A-477A-8022-0A01FCB9AF53 (AT) microsoft (DOT) com
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain;
| > | > | charset="Utf-8"
| > | > | Content-Transfer-Encoding: 7bit
| > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | Content-Class: urn:content-classes:message
| > | > | Importance: normal
| > | > | Priority: normal
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | Newsgroups: microsoft.public.sqlserver.olap
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.sqlserver.olap:64475
| > | > | X-Tomcat-NG: microsoft.public.sqlserver.olap
| > | > |
| > | > | I'm trying to add a measure group dimension with a relationship
type
| > of
| > | > fact.
| > | > | It looks like this is a
| > | > | DegenerateMeasureGroupDimension
| > | > |
| > | > | I've added it with AMO and the results look OK.
| > | > | It doesn't show up the same was as a manually created one in
the
cube
| > | > | dimension usage panel.
| > | > | It's saying "a fact dimension has been created in a way the
user
| > | > interface
| > | > | does not support".
| > | > |
| > | > | Is there an AMO Example for DegenerateMeasureGroupDimension
| > | > |
| > |
| > |
| > |
|
|
|




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.