| Chris 的个人资料Chris Webb's BI Blog日志列表 | 帮助 |
|
2008/11/27 NonEmpty() and that all-important second parameterHere's a question which comes up all the time - it was asked at Mosha's MDX seminar last week, and a friend of mine asked me about it recently too - what does the NonEmpty function do if you don't specify the second parameter? Let's take a look at some example queries. I think everyone knows that you can use NON EMPTY before an axis definition to remove all the empty tuples on that axis, as with: SELECT [Measures].[Internet Sales Amount] ON 0, The problem comes when people assume that you can use the NonEmpty() function in the following way to get the same result: SELECT [Measures].[Internet Sales Amount] ON 0, In a lot of cases you might not see any obvious differences between what the two uses return, but if you run the query above you can see a lot of empty rows returned so they clearly aren't the same. So what's happening? If you clear the cache, rerun this second query and then run a Profiler trace you can get a hint: Why are the Reseller Sales measure group partitions being hit? Because the Reseller Sales Amount measure is the default measure on the Adventure Works cube, and since we didn't specify a measure in the second parameter for NonEmpty() it's using the default measure to decide which dates have values or not. To fix this we can explicitly tell AS which measure to use: SELECT [Measures].[Internet Sales Amount] ON 0, The moral here is always, always, always specify a measure in the second parameter for NonEmpty() whenever you use it. If you don't you may get unexpected results back and you may also get poor performance, for example if the default measure comes from a very large measure group. Oh, and as a bonus tip, don't ever use NonEmptyCrossjoin() with AS2005 or later. It's difficult to use and frankly unpredictable in what it does sometimes; you can always do whatever you want with NonEmpty or Exists (when specifying a measure group in the third parameter) much more reliably and just as fast. For more information on this topic, have a look at this old-but-good blog post from Mosha: PASS Summit 08I’m back from my trip to Seattle at the PASS Summit and have just about recovered from the jet lag, so now’s a good time to blog about the last week. What did I get up to?
All in all I enjoyed myself and I think I made the right decision going to PASS rather than the BI Conference - there was more than enough BI content for me and the conference itself was well run and good fun. I'd really like it if PASS and the BI Conference were merged into one mega-conference so I didn't have to choose. 2008/11/25 MDXInjection utilityMiky Schreiber has just posted a cool utility on his blog that addresses what is, in my experience, a frequent need on many Analysis Services projects: the ability to apply a common set of calculations to a number of cubes. You can find out more and download it here: Definitely something that should be considered by the SSAS dev team for the next version. 2008/11/21 Oracle OLAP support for MDXIs that a pig I see flying past? It seems that the folks at Simba have come up with an OLEDB for OLAP provider for Oracle's OLAP option, so you'll be able to query Oracle OLAP direct from Excel 2007. More details here:
More evidence that it's the lure of direct Excel connectivity that's the driver for MDX adoption. This is a big win for MDX as a query language...
2008/11/16 AS2008 Performance Guide released2008/11/14 Who's going to PASS next week?I'll be there. In fact I'm sure just about everyone who is anyone in the world of MDX will, like me, be there on Monday at Mosha's MDX seminar - assuming, of course, that Mosha actually makes it himself this time...! Anyway, if you see me, say hello, and come along to my session first thing on Thursday morning. I'm going to be speaking about "How to build a SSIS, SSRS and SSAS monitoring solution using SSIS, SSRS and SSAS" - basically building a data warehouse to hold all the logging data that the three servers produce, building a cube on top and writing some queries/building reports so you can visualise activity. I submitted the abstract for this before I'd done any work on the subject and of course soon came to realise that it's a massive topic, so I've been working like mad for the past few weeks to get my demos and slides together. But I will have some cool stuff to show, I promise, even though I'll still be putting the finishing touches to it 5 minutes before the session starts. "MDX Solutions" in ChineseI've just been told that "MDX Solutions" has been translated into Chinese: It's a shame that Wiley aren't interested in doing a third edition at the moment, but luckily not much has changed in MDX between AS2005 and AS2008 so the content is still relevant. I see there's some competition coming in the future from "Microsoft SQL Server 2008 MDX Step-By-Step" though... 2008/11/11 SQLBits III: The MovieIf you didn't make it to the last SQLBits (yeah, I know you had a good excuse: it was on a Saturday and you had to wash your hair, or your wife doesn't let you out on weekends, or you live in Nebraska) then you're in luck: a film crew from Microsoft filmed most of the sessions including the whole BI track and they're now available for viewing on the SQLBits website: Enjoy! 2008/11/10 Nigel Pendse on GeminiI've already linked to Nigel Pendse's initial comments on Gemini, which you can see here: However those nice people at the OLAP Report have just given me access to see the subscriber-only content, which is probably the most detailed write-up available (I assume Nigel has been briefed by the Gemini dev team): It doesn't say anything much new, but I guess if you're someone like Qlikview you probably want to get as many details on this as you can! Nigel is much more positive about it all than I was; he may well have a better idea of MS's proposed solutions to the management problems everyone's been highlighting: "Microsoft has some clear ideas about the role IT will be able to play in Gemini deployments, but the details were slightly fuzzy during the October announcements. It promises more details will emerge in the following months". He also notes the problem of Excel users needing to define multidimensional calculations and says "Microsoft has not provided details of how this will be done, except to emphasize that Gemini users will not need to learn MDX. It's proposal is to allow simple dimensional tests in Excel-like formulas in Gemini. These Excel-like calculation rules will be equivalent to MDX, but far easier for an Excel user to understand". Hmm, we've already seen MDX and PEL try and fail to make multi-dimensional calculations easy to use... I wonder if we'll have a third stab at the problem? 2008/11/5 Interesting stuff on www.sqlserveranalysisservices.comJust had one of my occasional looks at Richard Tkachuk's site, http://www.sqlserveranalysisservices.com and there's some interesting new information on the home page. There's an article on how to handle time intervals in AS (I've got some ideas on a different way of handling this, but I'd need to test them out to see how they perform), a note on how the Aggregate function works with calculated measures, and a draft of the AS 2008 Performance Guide that is a must-read: 2008/11/4 Variation on the theme of cache-warming in SSISOver on SQLIS.com, Allan Mitchell shows a variation on my original approach on how to build a cache-warmer in Integration Services: The key difference is the Trace File Source component that allows you to connect direct to a trace file rather than have to persist the trace information to a SQL Server table. The component hasn't been released yet but it will be soon (Allan and Darren have been working on it for a while); I'm going to try to use it in my PASS Presentation in two weeks. Once it's out I intend to update my cache-warmer package and make it available for download from Codeplex or somewhere similar. I've got a few more ideas on how to improve it and I think it's something that a lot of people would find useful. |
|
|