Создание OLAP-клиентов с помощью Excel и Microsoft PivotTable Services

Листинг 8

// Добавим имя куба в определение источника данных
ConnStr := ‘OLEDB;Provider=MSOLAP; Initial Catalog=[OCWCube]; 
  ‘+
‘Data Source=’+ SaveDialog1.FileName + ‘; ‘+
// Предложение CREATE CUBE
‘CreateCube=CREATE CUBE [OCWCube] (‘+
‘DIMENSION [Country], ‘+
‘LEVEL [All] TYPE ALL, LEVEL [Country], LEVEL [City], ‘+
‘LEVEL [CompanyName],’+
‘DIMENSION [CompanyName1], ‘+
‘LEVEL [All] TYPE ALL, LEVEL [CompanyName1],’+
‘DIMENSION [Salesperson], ‘+
‘LEVEL [All] TYPE ALL, LEVEL [Salesperson], ‘+
‘DIMENSION [ProductName], ‘+
‘LEVEL [All] TYPE ALL, LEVEL [ProductName], ‘+
‘DIMENSION [OrderDate] TYPE TIME, ‘+
‘LEVEL [All] TYPE ALL, LEVEL [Year] TYPE YEAR, ‘+
‘LEVEL [Month] TYPE MONTH, ‘+
‘MEASURE [ExtendedPrice] FUNCTION SUM); ‘+
// Предложение INSERT INTO
‘InsertInto=INSERT INTO OCWCube([Country].[Country], [City], 
  ‘ +
‘[CompanyName], [ProductName].[ProductName], ‘ +
‘[CompanyName1].[CompanyName1],[Salesperson].[Salesperson],’+
‘[OrderDate],[ExtendedPrice], [CompanyName].[CompanyName] ) ‘+
‘OPTIONS ATTEMPT_ANALYSIS ‘+
// Запрос на выборку фактических данных
‘SELECT Invoices.Country, Invoices.City, ‘+
‘Invoices.Customers.CompanyName, Invoices.ProductName, ‘+
‘Invoices.Shippers.CompanyName, Invoices.Salesperson, ‘+
‘Invoices.OrderDate,Invoices.ExtendedPrice ‘+
‘FROM Invoices; Source_DSN=”DSN=’+ODBC_DSN+’”’;

возврат


Наш канал на Youtube

1999 1 2 3 4 5 6 7 8 9 10 11 12
2000 1 2 3 4 5 6 7 8 9 10 11 12
2001 1 2 3 4 5 6 7 8 9 10 11 12
2002 1 2 3 4 5 6 7 8 9 10 11 12
2003 1 2 3 4 5 6 7 8 9 10 11 12
2004 1 2 3 4 5 6 7 8 9 10 11 12
2005 1 2 3 4 5 6 7 8 9 10 11 12
2006 1 2 3 4 5 6 7 8 9 10 11 12
2007 1 2 3 4 5 6 7 8 9 10 11 12
2008 1 2 3 4 5 6 7 8 9 10 11 12
2009 1 2 3 4 5 6 7 8 9 10 11 12
2010 1 2 3 4 5 6 7 8 9 10 11 12
2011 1 2 3 4 5 6 7 8 9 10 11 12
2012 1 2 3 4 5 6 7 8 9 10 11 12
2013 1 2 3 4 5 6 7 8 9 10 11 12
Популярные статьи
КомпьютерПресс использует