Who is online?  162 guests and 0 members
Home  »  Blogs  »  DustinRyan  »  MDX Parameter with Multiple Members Consolidated into Single Value
  Rate This Blog Entry:  register  or  login

Author

DustinRyan DustinRyan (Member since: 11/2/2009 4:00:04 PM)
I am a consultant, developer, product support tech, trainer, and hitman/ ninja assassin for Pragmatic Works. Working with the amazing and versatile crew at Pragmatic Works allows me to learn new things daily and increase my knowledge at an exponential rate! Lately, I've spent most of my time developing business intelligence solutions for clients that involve SSRS, SSIS, and SSAS.

View DustinRyan 's profile

Comments (4)

DevinKnight
2/6/2010 8:45:33 AM DevinKnight said:
Cool post Dustin! That darn MDX comes up everwhere.
by
mikedavis
2/7/2010 4:17:32 PM MikeDavis said:
Good post, I like it.
by
MarkGStacey
4/18/2010 5:32:13 PM MarkGStacey said:
What, MDX isn't your favorite language? Hmmmk :-) What you can do, especially if you have the underlying tables, is something like this: SELECT 'A' Name, '( { [Test].[Class].&[1]&[A], [Test].[Class].&[2]&[A] } )"' Value UNION ALL SELECT 'B', '( { [Test].[Class].&[1]&[B], [Test].[Class].&[2]&[B] } )"' Value UNION ALL SELECT 'A+B', '( { [Test].[Class].&[1]&[A], [Test].[Class].&[2]&[A], [Test].[Class].&[1]&[B], [Test].[Class].&[2]&[B] } )' UNION ALL SELECT Class1.Name , '( { [Test].[Class].&[1]&[' + Class1.Name + '], [Test].[Class].&[2]&[' + Class1.Name + '] } )"' Value FROM classTable Class1 INNER JOIN classTable Class2 ON Class1.Name = Class2.Name AND Class2.ClassType = 2 WHERE Class1.ClassType = 1 And here you generate the set to look like the MDX set, but with more control over how it's built up. In addition, you could do the same, but replace the final select with a query against the cube using an OPENROWSET I VERY often do something similar with the openrowset for balancing my cubes - getting the cube data into a form where I can compare it easily to the table data
by
dustinryan
4/20/2010 8:53:15 PM DustinRyan said:
Cool, Mark. That's a good tip. Thanks.
by

Leave a comment


 
Type the characters:
 *
 
   

Join Business Intelligence Developer Network for FREE Today!

It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.

enter your email address:

Blogs RSS Feed

DustinRyan's latest blog posts

  • So if you missed JaxCodeCamp 2010, you missed one heck of a free training event! Each session I attended was incredible and I learned all kinds of new things even in some of the areas that I consider ...
  • The recording to yesterday's SQL Lunch session on Troubleshooting SSIS Package Development is now available for viewing at SQLLunch.com! Click here to make the jump and scroll to the bottom to see my ...
  • If you're into free training (and you should be if you work as an IT professional), head on over to SQL Lunch to see the current line up of speakers and sessions. Every session is free and are usually...
  • At some point or another, you've probably run into the road block that is the lack of an ISNUMERIC() equivalent within the SSIS expression language. While you can't use ISNUMERIC() in an SSIS transfor...
  • A fellow BIDN'er posted in the forums reporting some weird behavior in one of their SSRS 2008 reports. Apparently there's a known bug centering around using Me.Value in an expression in a report that ...
  • Well Jacksonville Code Camp 2010 is upon us and yours truly will be hosting a session. On Saturday, August 28th, 2010, Jacksonville Code Camp registration opens up at 7 a.m. The event will be held at ...
  • In SQL Server Analysis Services 2008, we have three storage mode options available to us: Relational Online Analytical Processing (ROLAP), Multidimensional Online Analytical Processing (MOLAP) and Hyb...
  • A couple blog posts ago , I discussed using a Common Table Expression (CTE) and the ROW_NUMBER() function to create a field in a data set the retrieves a field in the previous row. But since CTE's and...
  • Let's say your building an SSIS package with a data flow to move data from one database to another. You decide to use an OLE DB Source. For your Data Access Mode you select SQL Command and copy and pa...
  • In a recent project I've been tackling for the last couple months, I've been migrating several significant subsystems into a single larger system. In one of the tables I'm populating, there is a field...
  • In my previous blog post , I mentioned that there was a performance cost for using the LookUpCube function. Well recently a coworker asked me just home much of a performance hit was the LookUpCube fun...
  • In response to a forum question a fellow BIDN user had posted, I decided to write a blog that covers and expands upon what I demonstrated in my answer. Basically, the question boiled down to being abl...
  • Have you ever wondered how to force a carriage return inside a string within an SSRS expression or how to display a double quote ( " ) as a string? There's actually a fast an easy solution. The Chr() ...
  • If you're like me, you probably have a significant number of servers you access on a regular basis, which means every time you start up SQL Server Management Studio (SSMS) you have to log in to each s...
  • The ROW_NUMBER() function is a great function that was added with the release of SQL 2005 and is also included in SQL 2008. ROW_NUMBER makes it very easy to number your rows across the entire data set...
  • When developing an SSIS package, sometimes it can be frustrating trying to troubleshoot various issues and faults with the package. And if you're not a seasoned SSIS developer, you may not be sure abo...
  • I recently developed a series of reports that allows the user to view recently failed jobs by querying the MSDB database for job history information. By clicking the link "Click here to re-run the job...
  • Yesterday I was doing some work with the system tables in SQL Server 2008, specifically the tables related to jobs and job execution history. Those tables store dates and times in seperate fields as i...
  • A common reporting requirement an end user may request is the ability to exclude certain records from a report using a parameter. For example, I've had end users request the ability to hide records wh...
  • If you've ever tried to use an IIF statement expression to fix an error received by dividing by zero, you probably still received the divide by zero. Very frustrating. An expression like this returns ...
  • It's very easy to link to an SSRS report from within another application and pass your report's parameters in the URL. To do this, simply add "&", then your parameter name, then "=", and finally t...
  • It doesn't take long for an SSRS developer to run into those pesky blank pages popping up between pages or at the end of their report. Unlike SSRS 2005, 2008 does not automatically ignore the white sp...
  • If you ever created any calculations in your cube or in an MDX query that uses division, you've probably run into the issue of dividing by zero (0) or NULL. Dividing by 0 or NULL will show the ugly -1...
  • Today I was working on a report built on a cube and stumbled on to an interesting requirement by some of our client's end users (EU). EU wanted to be able to consolidate multiple, specific members int...
  • If you've done a couple cube based reports, you've run into the issue of the dates being in string format. Because the dates are strings inside your cube, you can't use the neat little date picker con...
Blogs RSS Feed

Latest community blog posts

  • Pirate Code: They're more like guidelines really... The last few weeks we've watched the drama unfold in regards to the PASS BOD elections. We've seen people attack criticize the NomCom, the board, PA...
  • Just a while ago I was watching a video on sqlshare Creating a Plan Guide for a Parameterized Statement By Andy Warren . Only then I heard about plan guides. I didn't know what plan guides were. Here ...
  • Unfortunately, I don't have one big topic to write about in this post, so I decided to share some observations from the past few weeks - little things that might be of interest in the next report you ...
  • In a previous post I wrote about getting started with PerformancePoint 2010. In that post you learned about what PerformancePoint is and where to open in in SharePoint 2010. Your next steps are to con...
  • So today at the office I was faced with one of the more common and important questions that come up regularly and that was ‘Where are we going for lunch?’ This usually in tells a few minor arguments a...
  • Problem: Everyone that's programmed a system that users will interact with has run across a statement like this one in the fact-finding stage. "I want to be able to search on phone number. I can't ima...
  • If you only get a chance to read one book this year, it should be Drive , The Surprising Truth about what Motivates Us. This book has made me rethink how I am motivated and how I can motivate others. ...
  • Recently one of my clients would like to see their Revenue figures represented some of the time as a positive (+VE) value and some time as a negative (-VE) value. They would like to have the ability t...
  • Lately, I've been enjoying various shows on the Science channel about Time and Space. No one yet understands exactly what time is yet - still, everyone wants to save some. I'd like to show how one mig...
  • I attended the 2010 Jacksonville Code Camp Sataurday and really was impressed with Pragmatic Works. The entire Business Intelligence stack was covered by speakers from PW including Brian Knight, Adam ...
  • One of the hardest things about starting a new project is getting to know the database with which you are working. Here is a quick way to make a list of the all columns along with the name of the corr...
  • I have presented you with a couple of easy puzzles in the last few posts. So, let's step it up a little with one that is a little more challenging. I have to be honest, this puzzle was sent to me by o...
  • Sometimes you may need to restart your instance of SQL Server. You should rarely do this on Production boxes, but in development or on your local desktop instance I restart my SQL Server instance fair...
  • First and foremost, I want to thank everyone who attended my presentation today. It got off to a late start due to the prior presentation running over and a little setup issues set me back a little bi...
  • The other day I was creating a report and it needed some sorting capabilities. I said to myself, "Self, there may not be a lot of begginers that know how to add sorting capability". What I would like ...
  • Puzzle #6 should not have presented too much of a challenge, it's intentions were to introduction you to the ORDER function that is available in MDX. Ok, so this is what I started with: This is a very...
  • This Saturday is Code Camp in Jacksonville, FL. There are a lot of great speakers lined up, some of which you may have seen at other events such as SQL Saturday. If your free on Saturday come on out a...
  • With the release of the SSRS 2008 R2 reporting developers now have a new tool that they can use when creating reports. The new tool I am talking about is the new map wizard. With this you can easily s...
  • If you've been under a rock the last few weeks you may not know that PASS is currently undergoing their board elections process. I'm not going to rehash the entire saga here but this is just a quick p...
  • The MS Communities Code Camp & Technology Summit is a Free , non-commercial event, open to everybody with an interest in any of the technologies being discussed. Development This year we will be r...
  • A few weeks ago Andy Leonard ( Blog | Twitter ) announced that he was stepping down from his position as PASS Regional Mentor. It is with great humbleness and excitement that I can officially say I'll...