| Michael Barrett's profileBI by Michael BarrettBlog | Help |
|
|
BI by Michael BarrettJanuary 31 Analysis Services 2005 performance guideThe Analysis Services 2005 performance guide has been released. Get it here: Analysis Services 2005 performance guide. Note that many of the suggestions in the paper only apply if you have installed SQL Server 2005 Service Pack 2 (yet to be released). December 12 SSIS: A distinct componentAs a follow up to Jamie Thomsons post on "SSIS: A distinct component please" (found here) I thought I would share how I have implemented a distinct component using the script component in the SSIS pipeline. The script component is - of course - set up to be asynchronous by modifying the synchronous input ID of the output from the script component. It will only be partially-blocking, however, as it does not need to wait for all rows to be passed in before the output is created. A new row is added to the output every time a new key value is encountered in the input. This is contrary to the distinct functionality of the built-in Sort component, where you have to wait for all rows to be passed in, before the distinct values are sent down the output. The implementation uses a hashtable to keep track of the distinct values, and to reproduce it you can do the following: 1. Create a new SSIS package SELECT Color 5. Tie the output of the OLE DB Source to the input of a new script component. Imports System Public Class ScriptMain
End Class 10. Optionally, connect the script component to a row count transformation and add a data viewer to the path between the two components. This example illustrates how to make a distinct operation on a single column in the data flow, but it can be easily extended to making a distinct operation on more than one column. July 05 MDX: Subcubes should set the current query contextCurrently, subcubes/subselects used in MDX queries in Analysis Services 2005 do not set the current query context. This is a huge problem in calculated members that need the current context in order to return correct results. For examples and an elaboration, please see: Excel 2007 makes extensive use of subselects/subcubes for restricting query results, so the problem will appear in this client application with the current behavior of AS 2005. If you agree with me, please vote for my suggestion at: http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=156581 May 01 SSIS: Handling large data flowsRecently I had an experience while developing an SSIS package that I would like to share. The package had a simple control flow containing 5 Execute SQL Tasks, one Send Mail Task and a Data Flow Task. Simple as this sounds, the data flow was really large. Some of the components that it contained were: March 08 MDX: EXISTING operator and sub-selectsThis is the first post in my blog, which will be focusing on BI-related issues on the SQL Server platform - i.e.: Analysis Services, Integration Services and Reporting Services. This blog entry is about the use of the EXISTING operator in MDX calculations (well, really it is about one of the pitfalls of using EXISTING). The operator is new to Analysis Services 2005 and can be used to filter a set by the current coordinate in the cube. This is very useful and can for instance be used for making MDX calculations "multi-select friendly" (for more details on this, see Mosha's blog post here: http://www.sqljunkies.com/WebLog/mosha/archive/2005/11/18/multiselect_friendly_mdx.aspx). The following MDX query (running on the Adventure Works cube database) illustrates the use of EXISTING. WITH MEMBER [Measures].[MyDate] AS This query will return the last date in calendar year 2003, which of course is december 31 2003. It does this because the WHERE clause slices on calendar year 2003 and the last date to exist with this is december 31 2003. What happens if we rewrite the query a bit to use a subselect to filter on calendar year 2003 instead of specifying this in the WHERE clause? WITH MEMBER [Measures].[MyDate] AS Now, I might have been the only one, but I certainly expected this query to return the same date as the first one: December 31 2003. This is not the case. Our new, rewritten, query will return August 31 2004 (which is the last available date in the date dimension in the Adventure Works cube database). What this really means is that our subselect does not set the current coordinate in the cube (in Moshas words it "merely does top level Exists with axis and applies visual totals"). This is really important to remember if you ever want to use the EXISTING operator for some fancy MDX calculations, because if your client tools use subselects (which, for example, Excel 12 does extensively I am told), you might run into some unexpected results. Now, it is not all bad - if our query for instance sets the current coordinate on the date dimension by using one of the hierarchies from this dimension on an axis, we will get our expected result. WITH MEMBER [Measures].[MyDate] AS UPDATE 20060610: The problems with subselects mentioned above are not limited to the use of the EXISTING operator. They apply in all situations where the current context is needed in an MDX expression in order to return a correct result. |
||||
|
|