dbTalk Databases Forums  

custom aggregation using DSO.

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


Discuss custom aggregation using DSO. in the microsoft.public.sqlserver.olap forum.



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

Default custom aggregation using DSO. - 09-08-2003 , 06:27 PM






Hello All,

I'm trying to create aggregations for a cube using DSO. I looked for a piece
of code that would help me out but I couldn't find any. All the example
codes are using the PartitionAnalyzer. I know how I'm going to query the
cube exactly so I don't want to create extra aggregations. I tried something
like this (to query in 3 dimensions for measure Trx Count) but it doesn't
seem to work. Any help will be appreciated.

Set dsoPartition = dsoCube.MDStores(1)

Set dsoAggregation = dsoPartition.MDStores.AddNew("BranchTrxDate")

dsoAggregation.Dimensions.AddNew ("ImportDimBranch")
dsoAggregation.Dimensions.AddNew ("ImportDimTran")
dsoAggregation.Dimensions.AddNew ("ImportDimDate")

dsoAggregation.Measures.AddNew ("Trx Count")

dsoCube.Update
dsoCube.Process processFull

Cagdas Ucar (Chadash Uchar)

Exametric, Inc.

Software Engineer





Reply With Quote
  #2  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: custom aggregation using DSO. - 09-09-2003 , 12:37 PM






Cagdas,

Here's some sample code from a sample application that ships with the SQL 2k
Resource Kit and the Accelerator (which you can download at
www.microsoft.com/solutions/bi). After you install the Accelerator a tools
directory will be created on your disk that contains an application called
the Partition Aggregation Utility. It includes the source code. Basically,
what you're missing is that aggregations are made up of dimension levels.

Sean


--
Sean Boon
SQL Server BI Product Unit

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


'Create new aggregations
For aggCounter = 0 To lstAgg(0).ListItems.Count - 1
Set dsoAgg = m_dsoPart.MDStores.AddNew("CustomAgg" &
CStr(aggCounter))
dsoAgg.IsDefault = True
For dimCounter = 0 To numDims - 1
Set dsoAggDim =
dsoAgg.Dimensions(lblDimName(dimCounter))
For levCounter = 1 To
imgCmbLevs(dimCounter).ComboItems(lstAgg(dimCounte r).ListItems(aggCounter +
1).Text).Index
If Not
imgCmbLevs(dimCounter).ComboItems(levCounter).Inde x = 1 Then
dsoAggDim.Levels.AddNew
imgCmbLevs(dimCounter).ComboItems(levCounter)
End If
Next
Next
Next
"Cagdas Ucar" <cagdas.ucar (AT) exametric (DOT) com> wrote

Quote:
Hello All,

I'm trying to create aggregations for a cube using DSO. I looked for a
piece
of code that would help me out but I couldn't find any. All the example
codes are using the PartitionAnalyzer. I know how I'm going to query the
cube exactly so I don't want to create extra aggregations. I tried
something
like this (to query in 3 dimensions for measure Trx Count) but it doesn't
seem to work. Any help will be appreciated.

Set dsoPartition = dsoCube.MDStores(1)

Set dsoAggregation = dsoPartition.MDStores.AddNew("BranchTrxDate")

dsoAggregation.Dimensions.AddNew ("ImportDimBranch")
dsoAggregation.Dimensions.AddNew ("ImportDimTran")
dsoAggregation.Dimensions.AddNew ("ImportDimDate")

dsoAggregation.Measures.AddNew ("Trx Count")

dsoCube.Update
dsoCube.Process processFull

Cagdas Ucar (Chadash Uchar)

Exametric, Inc.

Software Engineer







Reply With Quote
  #3  
Old   
Cagdas Ucar
 
Posts: n/a

Default Re: custom aggregation using DSO. - 09-10-2003 , 04:08 PM



That solved everything. Thank you.

"Sean Boon [MS]" <seanboon (AT) online (DOT) microsoft.com> wrote

Quote:
Cagdas,

Here's some sample code from a sample application that ships with the SQL
2k
Resource Kit and the Accelerator (which you can download at
www.microsoft.com/solutions/bi). After you install the Accelerator a
tools
directory will be created on your disk that contains an application called
the Partition Aggregation Utility. It includes the source code.
Basically,
what you're missing is that aggregations are made up of dimension levels.

Sean


--
Sean Boon
SQL Server BI Product Unit

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


'Create new aggregations
For aggCounter = 0 To lstAgg(0).ListItems.Count - 1
Set dsoAgg = m_dsoPart.MDStores.AddNew("CustomAgg" &
CStr(aggCounter))
dsoAgg.IsDefault = True
For dimCounter = 0 To numDims - 1
Set dsoAggDim =
dsoAgg.Dimensions(lblDimName(dimCounter))
For levCounter = 1 To
imgCmbLevs(dimCounter).ComboItems(lstAgg(dimCounte r).ListItems(aggCounter
+
1).Text).Index
If Not
imgCmbLevs(dimCounter).ComboItems(levCounter).Inde x = 1 Then
dsoAggDim.Levels.AddNew
imgCmbLevs(dimCounter).ComboItems(levCounter)
End If
Next
Next
Next
"Cagdas Ucar" <cagdas.ucar (AT) exametric (DOT) com> wrote in message
news:#acD3CmdDHA.2340 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Hello All,

I'm trying to create aggregations for a cube using DSO. I looked for a
piece
of code that would help me out but I couldn't find any. All the example
codes are using the PartitionAnalyzer. I know how I'm going to query the
cube exactly so I don't want to create extra aggregations. I tried
something
like this (to query in 3 dimensions for measure Trx Count) but it
doesn't
seem to work. Any help will be appreciated.

Set dsoPartition = dsoCube.MDStores(1)

Set dsoAggregation =
dsoPartition.MDStores.AddNew("BranchTrxDate")

dsoAggregation.Dimensions.AddNew ("ImportDimBranch")
dsoAggregation.Dimensions.AddNew ("ImportDimTran")
dsoAggregation.Dimensions.AddNew ("ImportDimDate")

dsoAggregation.Measures.AddNew ("Trx Count")

dsoCube.Update
dsoCube.Process processFull

Cagdas Ucar (Chadash Uchar)

Exametric, Inc.

Software Engineer









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.