dbTalk Databases Forums  

Setting SliceValue for New OLAP Partition using DSO

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


Discuss Setting SliceValue for New OLAP Partition using DSO in the microsoft.public.sqlserver.olap forum.



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

Default Setting SliceValue for New OLAP Partition using DSO - 05-04-2004 , 11:36 PM






Hi

In Chapter 18 of SQL Server 2000 Resource Kit, there's a sample code of cloning a partition in OLAP using DSO. I
try the example and it works well. But I noticed that the new partition that was created didn't have the correct Data Slice

Part of the coding is like this

' Change the definition of the data slice used by the ne
' partition, by changing the SliceValue properties of the
' affected levels and dimensions to the desired values
dsoPartitionNew.Dimensions("Time").Levels("Year"). SliceValue = "1998
dsoPartitionNew.Dimensions("Time").Levels("Quarter ").SliceValue = "Q4
dsoPartitionNew.Dimensions("Time").Levels("Month") .SliceValue = "12

The 'New Partition' Data Slice always clone the value from the 'Original Partition', and the settings above didn't
give any changes to the value. Why is it? And how to resolve it

Here's my testing scenario to reproduce the issue
- Install Analysis Service
- Apply SP3
- Run the script (at this point, you'll have the script work perfectly
- Delete the 'NewPartition1' to restart the tes
- Edit the 'Sales' partition, set the 'Data Slice' to '1997' (as it supposed to be
- Run the scrip
You'll find that the 'NewPartition1' will not have the correct setting for the 'Data Slice'

I try some combination of the test, and I conclude that if the 'Data Slice' of the 'Original Partition' had already
been editted manually. Than the cloning task will raise this issue. You can try to omit the 'Data Slice' of
the 'Sales' partition to make it like the first time you have it. But the cloning task won't be correct anymore

Thanks in Advanc

Best Regards
Jono Indrawijay


Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Setting SliceValue for New OLAP Partition using DSO - 05-05-2004 , 01:39 PM






On the SQL Server 2000 Resource Kit, there is a program called the Meta-data
scripter. It generates a VB program which will re-create objects. So the way
to get sample code is to:

1) Create your partition without the data slice.
2) Run the meta-data scripter against the partition
3) Add your data slice
4) Run the meta-data scripter against the partition

Compare the VB programs generated in step #2 and #4.

--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager


"Jono" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

In Chapter 18 of SQL Server 2000 Resource Kit, there's a sample code of
cloning a partition in OLAP using DSO. I
try the example and it works well. But I noticed that the new partition
that was created didn't have the correct Data Slice.

Part of the coding is like this :

' Change the definition of the data slice used by the new
' partition, by changing the SliceValue properties of the
' affected levels and dimensions to the desired values.
dsoPartitionNew.Dimensions("Time").Levels("Year"). SliceValue = "1998"
dsoPartitionNew.Dimensions("Time").Levels("Quarter ").SliceValue = "Q4"
dsoPartitionNew.Dimensions("Time").Levels("Month") .SliceValue = "12"

The 'New Partition' Data Slice always clone the value from the 'Original
Partition', and the settings above didn't
give any changes to the value. Why is it? And how to resolve it?

Here's my testing scenario to reproduce the issue:
- Install Analysis Services
- Apply SP3a
- Run the script (at this point, you'll have the script work perfectly)
- Delete the 'NewPartition1' to restart the test
- Edit the 'Sales' partition, set the 'Data Slice' to '1997' (as it
supposed to be)
- Run the script
You'll find that the 'NewPartition1' will not have the correct setting for
the 'Data Slice'.

I try some combination of the test, and I conclude that if the 'Data
Slice' of the 'Original Partition' had already
been editted manually. Than the cloning task will raise this issue. You
can try to omit the 'Data Slice' of
the 'Sales' partition to make it like the first time you have it. But the
cloning task won't be correct anymore.

Thanks in Advance

Best Regards,
Jono Indrawijaya




Reply With Quote
  #3  
Old   
Jono Indrawijaya
 
Posts: n/a

Default Re: Setting SliceValue for New OLAP Partition using DSO - 05-05-2004 , 11:11 PM



Hi Dave

I study the code from the MetaDataScripter and finally I found the missing code setting for the data slice

This is the correct script

dsoPartitionNew.Dimensions("Time").CustomPropertie s("DimensionSlice").Value = "1998.Q4.12
dsoPartitionNew.Dimensions("Time").Levels("Year"). MemberKeyColumn = """time_by_day"".""the_year""
dsoPartitionNew.Dimensions("Time").Levels("Year"). SliceValue = "1998
dsoPartitionNew.Dimensions("Time").Levels("Quarter ").MemberKeyColumn = """time_by_day"".""quarter""
dsoPartitionNew.Dimensions("Time").Levels("Quarter ").SliceValue = "Q4
dsoPartitionNew.Dimensions("Time").Levels("Month") .MemberKeyColumn = """time_by_day"".""month_of_year""
dsoPartitionNew.Dimensions("Time").Levels("Month") .SliceValue = "12

The most important code is the first line. It's there to set the CustomProperties("DataSlice") of "Time" dimension in the new partition

Many thanks for your help :

Best Regards
Jono Indrawijay
PT eBiz Cipta Solus
Microsft Certified Partner - Indonesia

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.