DAT 378 SQL Server 2000 Bringing The Best of Reporting Services and Analysis Services Together Sean Boon Program Manager, BI Systems
AgendaAgenda Benefits of Analysis Services and Reporting Services Building Reports Based on Analysis Services Cubes in SQL Server 2000 MDX tips Parameters Drill-down reports Render reports from Analysis Services What’s new in SQL Server 2005
A Common Question For our business intelligence solution should we use OLAP or Reporting? For our business intelligence solution, how can we use both Analysis Services and Reporting Services?
Benefits Of Reporting Services Report Management Scheduling, processing, repository, etc. Flexible schema/database support 3rd normal form, star, snow-flake Support for many data sources….including Analysis Services Support for many data sources….including Analysis Services Multiple delivery formats HTML, Excel, PDF, , etc. Some interactivity drill-down, drill-through Support for parameters
Benefits of Analysis Services Multi-dimensional navigation and query language Example: Products by Time by Region Slice/dice, drill-down, drill-through Aggregations for fast query response MOLAP storage Partitioning and queries Pyramid operations Powerful analytical functions via MDX.Lag(), MTD(), YTD(), ClosingPeriod()
Reporting Services and Analysis Services Office Custom Application Browser Cube Browser Action Delivery Targets ( , SharePoint, Custom) Output Formats (HTML, Excel, PDF, Custom) Data Sources (SQL, OLE DB, XML/A, ODBC, Oracle, Custom) Security Services (NT, Passport, Custom) XML Web Service Interface SQL Server Catalog Report Processing Data Processing Sheduling and Delivery Rendering Security Report Server
Building Reports From OLAP MDX And Reporting Services MDX is multi-dimensional and flexible MDX is a visual language Queries are constructed in many cases based on expected layout of data for the user Data Regions in Reporting Services are designed to work with flat data sets No MDX Query Designer MDX results will be flattened What you see in the MDX sample application is not what you’ll see in Reporting Services
Building Reports From OLAP Flattened MDX Lowest level through the highest level of each dimension that participates in the query is returned as a field One field per level (ALL) Member is not included Using the DIMENSION PROPERTIES syntax only returns the properties requested
Building Reports From OLAP Flattened MDX Examples Query #2 SELECT {[Measures].[Unit Sales]} on Columns, CROSSJOIN({[Time].[month].members}, {[Products].[Product Family].members}) on rows Query #1 SELECT CROSSJOIN({[Product].[Product Family].members}, {[Measures].[Unit Sales]}) on Columns, {[Time].[month].members} on rows
Flattened MDX
Building Reports From OLAP MDX Guidelines MDX Queries should place Measures on the column axis SELECT {[Measures].[MeasureName]} On Columns FROM CubeName For calculated members… Specify a parent member Bad Syntax: With Member [Store].[MyStores] Good Syntax: With Member [Store].[All Store].[My Stores] Use calculated members to return dimension properties instead
Static Report
Building Reports From OLAP MDX Parameters Analysis Services does not support parameterized queries Step 1: Build an MDX Query to populate the parameter lists. Step 2: Setup the parameter. Step 3: Build the dataset for the data region without the parameter and bind the fields. Step 4: Change the query for the dataset into an expression that will be evaluated when the report executes.
Building Reports From OLAP MDX Parameters: Parameter Query Use calculated members on the Measures Dimension to return value and labels for parameters. UniqueName for parameter value, Name for label Solves issue of binding parameter to a single field Helps ensure MDX statement is valid Space VBA function combined with Level.ordinal to produce a hierarchy effect
Building Reports From OLAP MDX Parameters Example: With Member [Measures].[TimeMemberUniqueName] as '[Time].currentmember.UniqueName' Member [Measures].[TimeDisplayName] as 'Space([Time].Currentmember.Level.Ordina l * 4) + Time.Currentmember.Name' SELECT {[Measures].[TimeMemberUniqueName], [Measures].[TimeDisplayName]} on Columns, {[Time].members} on rows FROM SALES
Building Reports From OLAP MDX Parameters: Dynamic Query Turn the query for the dataset into an expression… =“” Single line…no carriage returns Build the data region queries without parameters first to bind the fields Example ="SELECT {[Measures].[Unit Sales]} on columns, ORDER([Promotion Media].[Media Type].members,[Measures].[Unit Sales],DESC) on rows FROM SALES WHERE (" & Parameters!pTime.Value & ")“ ="SELECT {[Measures].[Unit Sales]} on columns, ORDER([Promotion Media].[Media Type].members,[Measures].[Unit Sales],DESC) on rows FROM SALES WHERE (" & Parameters!pTime.Value & ")“
Building Reports From OLAP Parameters Ideas for Large Dimensions Option 1: Use Cascading Parameters Option 2: Create a Search Parameter Use the INSTR() function {Filter([Customers].[Name].members INSTR(Customers.currentmember.name, """ & parameters!pCustomerSearch.Value & """) > 0)} ON ROWS FROM SALES "
MDX Parameters
Building Reports From OLAP Creating A “Drill-Down” Report Option 1: Return data from just single level of each dimension Use Reporting Services aggregates Option 2: Use data directly from cube Benefit is that you don’t recreate business logic (calculations) in two places Use grouping on tables and set Filters on the groups Use LEN() function to filter data in the group appropriately Result is that you group on a single record… the record you want displayed
Drilldown Reports
Using Actions Analysis Services URL action type to issue a report Great for Drillthrough scenarios Flexibility to retrieve data from additional sources Considerations/Tips Turn on IIS Logging (all properties) You may need to do some string manipulation Use member properties to store part of the URL Excel!Substitute() function, or UDF
Analysis Services Actions
SQL Server 2005 Reporting Services will include an MDX/DMX Query Designer Data will still be flattened Measures will be on columns KPI Support MDX Parameter support Server side aggregates Engine Support (Beta 2) Designer Support (RC 1) Server side formatting (Wishlist)
SQL Server 2005
Building Reports From OLAP Resources OLAP RDL Samples ils.aspx?FamilyID=f9b6e945-1f4c-4b7c- 9c83-c6801f0576ff&DisplayLang=en ils.aspx?FamilyID=f9b6e945-1f4c-4b7c- 9c83-c6801f0576ff&DisplayLang=en Upcoming Whitepapers Integrating Analysis Services with SQL Server 2000 Reporting Services Advanced Report Authoring with SQL Server 2000 Reporting Services
Attend a free chat or web cast List of newsgroups communities/newsgroups/en-us/default.aspx Microsoft Community Sites Locate Local User Groups Community sites
Q1:Overall satisfaction with the session Q2:Usefulness of the information Q3:Presenter’s knowledge of the subject Q4:Presenter’s presentation skills Q5:Effectiveness of the presentation Please fill out a session evaluation on CommNet
© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.