Recently, I embarked on a mission to become proficient at writing MDX queries. This is a challenge, as many of you may already know. MDX, though a query language, is very different from T-SQL as I quickly found out. Each week I will share with you a puzzle and then a couple of days later I will share my solution. Please don’t post your solutions on this blog post. Only post them on the Solution post, which will contain Solution in the title. Each solution post will contain a section on terminology and concepts if any new ones are introduced and the MDX query that is the solution to the puzzle. In this first posting there will be a few. The puzzles will start out very basic, but will move to more advanced MDX techniques as time progresses and my skills improve. I will be using the Adventure Works 2008 R2 cube, which can be downloaded from codeplex. So, let’s get started.
My first puzzle was to write what I thought was a very simple query. Here is the puzzle:
Remember, don’t post you solutions here. Save them for my solution post. I will post it along with the steps that was taken to solve the puzzle in a couple of days. Here is a screen shot of what the results should look like:
Don’t forget to check back in a couple days for the solution.
Talk to you soon,
Founder www.TSQLScripts.com and www.SQLLunch.com.
Visit www.BIDN.com, Bring Business Intelligence to your company.
I really look forward to this series. Thanks.
This looks like the Adventureworks database. For completeness, which version of SQL Server are you using?
Daniel I am using the R2 version. Stay tuned for the solution to Puzzle #1.
Here is the MDX Puzzles index: http://ssas-wiki.com/w/Articles#MDX_Puzzles