ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Get OLAP cube name (https://www.excelbanter.com/excel-discussion-misc-queries/242816-get-olap-cube-name.html)

cottage6

Get OLAP cube name
 
Hello,
I'm not very experienced with OLAP cubes, but have been asked to see if
there's a way to get the name of the OLAP cube associated with a pivot table
in a spreadsheet. It looks to me like it's easy in Excel 2007 to see the
Workbook Connections, but I do not see a way in the earlier versions. Is
that correct, or is there a way to get the cube name? Unfortunatley, we have
users here on different Excel versions. Thanks!

Michael Wong

Get OLAP cube name
 

The code below is the core that you are in need. There may be more
properties of the DataColumn that you need to look at, but this should
get you started.



Code Snippet

Dim svr As New Server

svr.Connect(".\sql05")

Dim db As Database

db = svr.Databases.GetByName("Adventure Works DW")

Dim dsv As DataSourceView = db.DataSourceViews.GetByName("Adventure
Works Dw")

Dim dimCust As Dimension = db.Dimensions.GetByName("Customer")

Dim attCust As DimensionAttribute = dimCust.Attributes(0)

Dim colBinding As ColumnBinding = CType(attCust.NameColumn.Source,
ColumnBinding)

Dim col As Data.DataColumn =
dsv.Schema.Tables(colBinding.TableID).Columns(colB inding.ColumnID)

Console.WriteLine(col.ExtendedProperties("Computed ColumnExpression"))


Still if you can't get it I would also recommend a book on OLAP and
believe me its pretty informative.
The 'book is available on Amazon ' (http://tinyurl.com/yelxeyd) & you
can buy an e-book directly from the publisher by writing
.


--
Michael Wong
------------------------------------------------------------------------
Michael Wong's Profile:
http://www.thecodecage.com/forumz/me...hp?userid=1001
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=135386



All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com