Friday, January 16, 2009

Wednesday, January 14, 2009

Tuesday, January 13, 2009

MDX + T-SQL: Combining relational and multi-dimensional data into one query result set

Quite interesting
http://sqlblogcasts.com/blogs/drjohn/archive/2008/09/27/mdx-and-sql-combining-relational-and-multi-dimensional-data-into-one-query-result-set.aspx

Complicated WHERE Clause

Goal:
The filter is as followed.

_All Releases
Overflow
Release 1
Release 2
Release 3
Release 4
Release 5

When user selects _All Releases, the filter should only filter out Overflow. When user selects Overflow, the filter should only take Overflow. When user selects Release 1, the filter should take Iteration 1 through 9. When user selects other releases, the filter should take the selected release.

Solution:
((@Release='_All Releases' AND (i.[Iteration Path] <> '\Cobalt Product Backlog\Overflow'))OR (@Release = 'Overflow' AND i.[Iteration Path] = '\Cobalt Product Backlog\Overflow')OR (@Release <> '_All Releases' AND @Release <> 'Overflow' AND (i.[Iteration Path] LIKE '\Cobalt Product Backlog'+ CASE @Release WHEN 'Release 1' THEN '\Iteration%' ELSE '\'+@Release+'%' END)))

Thanks to the following post:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54046

Monday, January 5, 2009

MDX Using SUM() to Convert A Query to A MDX Statement

Using SUM() function allows you to convert a regular MDX query to a MDX statement. So it can be used in for calculated member. The post below talks about it:

http://social.msdn.microsoft.com/forums/en-US/sqlanalysisservices/thread/7c2b58e1-4b20-4f8b-866f-7c328add916d/

If more than one set if required to slice the data, wrap the sets and measure with SUM() function. It's like using a tuple that allows slicing by sets instead of members. See example:

SUM(([Measures].[_Microsoft_VSTS_Scheduling_CompletedWork], [WorkStreams], [Work Item].[System_WorkItemType].&[eScrum Sprint Task]))

MDX Dynamic Sets

Interesting stuff
http://www.sqljunkies.com/WebLog/mosha/archive/2007/08/24/dynamic_named_sets.aspx

MDX Iterative Calculations

I found this topic interesting. Will look at it later:

http://social.msdn.microsoft.com/forums/en-US/sqlanalysisservices/thread/84a04c2c-a758-4092-9ef7-74f51116cbb0/