Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Carriage Returns being added to SliceValue

Author  Topic 

Bounty Bob
Starting Member

12 Posts

Posted - 2003-08-28 : 06:42:57
Hi all,

I'm trying to set the SliceValue for the time dimension of a partition. The problem I have is that a Carriage Return is being added to each level so when I try to process the Partition I get the following error: -

Processing error [Object does not exist] 'All Year
1998
Quarter 2'

My code is shown below: -

Dim dsoServer As New DSO.Server
Dim dsoDB As DSO.MDStore
Dim dsoCube As DSO.MDStore

Dim dsoPartition As DSO.MDStore
Dim dsoDimension As DSO.Dimension
Dim dsoLevel As DSO.Level

dsoServer.Connect "MyServer"
Set dsoDB = dsoServer.MDStores("Tutorial")

Set dsoCube = dsoDB.MDStores("Sales")
Set dsoPartition = dsoCube.MDStores("Sales 98")

Set dsoDimension = dsoPartition.Dimensions("Time")

Set dsoLevel = dsoDimension.Levels("(All)")
dsoLevel.SliceValue = "All Time"

Set dsoLevel = dsoDimension.Levels("Year")
dsoLevel.SliceValue = "1998"

Set dsoLevel = dsoDimension.Levels("Quarter")
dsoLevel.SliceValue = "Quarter 2"

dsoPartition.Update
dsoPartition.Process

Does anyone know how I can prevent this carriage return being appended to each level?

Cheers

Rob

PS. I've already tried setting the SliceValue and then removing the last character. It would seem that the CR's only get added when the "Process" is executed.
   

- Advertisement -