FindTech Blogs
Contrubutor ListTopic ListAbout Us
Chris Webb's BI Blog
  Search this blog

Description:

Chris Webb has been working with the Microsoft Business Intelligence toolset since 1998. His main focus is Microsoft SQL Server Analysis Services - complex MDX queries and calculations are his particular interest - although he has much experience with Reporting Services, Integration Services and various other related tools. He is the director of Crossjoin Consulting (www.crossjoin.co.uk), a UK-based BI consultancy, and his past experience includes three years with Microsoft Consulting Services and time spent on BI projects in a wide range of industries including pharmaceuticals, banking, finance, manufacturing, engineering and retail. He is a co-author of the book "MDX Solutions with Microsoft SQL Server Analysis Services 2005 and Hyperion Essbase" along with George Spofford and others, and is an active member of the Microsoft BI community, contributing regularly to newsgroups and online forums and speaking at conferences.


By Chris Webb    About this blogger

Show Hidden Objects in the Calculations tab

Here's a new button I've just noticed in the toolbar on the Calculations tab in BIDS 2008: Show Hidden Objects. Quite often when you're writing MDX you want to reference hierarchies that are hidden to the end user, and in BIDS 2005 you had to unhide them to be able to see them (and so find out their unique name) in the metadata pane, which was a pain; now in BIDS 2008 you just need to click the new 'Show Hidden Objects' button to be able to see them. For some bizarre reason it doesn't seem to allow me to see hidden sets or calculated members though - why?

showhiddenobjects

Categories: analysis services

Kalido Universal Information Director now generates Analysis Services cubes

Here's the press release from Kalido:
http://www.kalido.com/5a04ea36-c50e-4617-b25d-85ea56a22690/news-and-events-press-center-press-releases-detail.htm

I don't have any direct experience with Kalido's products (although I've heard good things) but I'd be interested to see the cubes it generates. I wonder to what extent it's possible to optimise automatically generated cubes?

Categories: on the internet

SQLBits III - Registration Now Open!

Registration for SQLBits III, to be held at Hatfield in the UK on September 13th, is now open! SQLBits is the UK's finest SQL Server technical conference, and it's 100% free to attend too. Take a look at:
http://www.sqlbits.com
...to see what we've got lined up. We've had an amazing 63 session submissions this time (the BI track is the strongest yet, in my opinion) so we're asking everyone who registers to vote on the sessions they'd like to see. We're also running a competition to design a logo for the day too, and you can vote on the logos here:
http://www.sqlbits.com/LogoCompetition.aspx
There are also SQLBits groups on Facebook and LinkedIn if you'd like to keep in touch with other people who are going or share photos etc. And as I've said before, we'd still like to talk to any companies who are interested in sponsoring the event.

Incidentally, Hatfield is just north of London and right next to Luton airport, so it's very easy to get to if you're coming from Europe. Why not pop over on Easyjet, and let your significant other go shopping in London for the day while you enjoy the conference?

One other thing to mention is that we're having a training day at the same venue the day before, September 12th. There are a number of reasonably-priced one-day seminars on SQL Server related subjects to choose from:
http://www.sqlbits.com/information/TrainingDay.aspx
...including, as you can see, an introduction to SQL Server BI called 'Making the most of data through business intelligence' run by me and Allan Mitchell (SSIS MVP and one of the guys behind http://www.sqlis.com/). If you know a DBA, business analyst or manager who wants to learn more about BI then it's the ideal way to get them out of the office for the day - just tell them it's a trip to see Mitchell and Webb perform live.

Categories: events

Last night's BI evening event

I just wanted to say a quick thank you to everyone who attended last night's BI evening event at TVP, especially to Jes Kirkup of TAH (TAH also very kindly provided the beer and pizza during the break, which I'm very grateful for) and Jeremy Kashel of Adatis. I've asked them both to post their slides up on the web so once they've done that I'll post the links here.

I promise that it won't be quite so long before we have another event at TVP - I'll try to do a better job of alternating between central London and TVP because I know we get a completely different group of people at each venue.

Categories: events

Named Sets, AutoExists and Katmai

A couple of months ago Radim Hampel pointed out to me some very weird stuff happening with named sets and the Where clause. Since it turned out that Darren had run into the same issue and also been thrown by it, and since I tested it out on Katmai CTP6 and could see that it was behaving differently from AS2005, I opened an item on Connect:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=331186

And now, after a long and detailed email thread involving Mosha, Edward Melomed, Marius Dumitru, Darren and Deepak we've got to the stage where I understand what's going on, Katmai RC0 does roughly what I want, and I can blog about it!

Let me explain what I saw first. What would you expect the calculated member in following query to return?

--Query 1
WITH
SET mytestset AS
PeriodsToDate
(
[Date].[Calendar].[Calendar Year]
,[Date].[Calendar].[Month].&[2004]&[6]
)
MEMBER measures.test AS
SetToStr(mytestset)
SELECT
measures.test ON 0
FROM [adventure works]
WHERE
[Date].[Calendar].[Month].&[2004]&[7]

Just from looking at the code I would have set the calculated member should return the string representation of the set from January 2004 to June 2004. But if you run the query you will in fact see that it returns the set containing the member July 2004 on both AS2005 and Katmai. To me that made absolutely no sense... Now, take a look at this query:

--Query 2
WITH
SET mytestset AS
[Date].[Calendar].[Month].&[2004]&[6]
MEMBER measures.test AS
SetToStr(mytestset)
SELECT
measures.test ON 0
FROM [adventure works]
WHERE
[Date].[Calendar].[Month].&[2004]&[7]

On AS2005 the calculation returns June as I would expect, on Katmai it returns an empty set. Now run this query:

--Query 3
WITH
SET mytestset AS
{
[Date].[Calendar].[Month].&[2004]&[5]
,[Date].[Calendar].[Month].&[2004]&[6]
}
MEMBER measures.test AS
SetToStr(mytestset)
SELECT
measures.test ON 0
FROM [adventure works]
WHERE
[Date].[Calendar].[Month].&[2004]&[7]

and this query:

--Query 4
WITH
SET mytestset AS
(
[Date].[Calendar].[Month].&[2004]&[5]
:
[Date].[Calendar].[Month].&[2004]&[6]
)
MEMBER measures.test AS
SetToStr(mytestset)
SELECT
measures.test ON 0
FROM [adventure works]
WHERE
[Date].[Calendar].[Month].&[2004]&[7]

...which to me should do the same thing. On AS2005 query 3 returns the set May and June but Katmai returns an empty set; query 4 returns an empty set on both AS2005 and Katmai. At this point I could see that something funny was happening that I didn't like!

What are the practical implications of this? Take the following query from Mosha's blog entry on ranking:

WITH
SET OrderedEmployees AS
Order
(
[Employee].[Employee].[Employee].MEMBERS
,[Measures].[Reseller Sales Amount]
,BDESC
)
MEMBER [Measures].[Employee Rank] AS
Rank
(
[Employee].[Employee].CurrentMember
,OrderedEmployees
)
SELECT
[Measures].[Employee Rank] ON 0
,[Employee].[Employee].[Employee].MEMBERS ON 1
FROM [Adventure Works]

Run it and you'll see that the Employee with the key 46, A Scott Wright, has a rank of 18. Now let's slice by this Employee:

WITH
SET orderedemployees AS
Order
(
[Employee].[Employee].[Employee].MEMBERS
,[Measures].[Reseller Sales Amount]
,bdesc
)
MEMBER measures.[employee rank] AS
Rank
(
[Employee].[Employee].CurrentMember
,orderedemployees
)
SELECT
measures.[employee rank] ON 0
FROM [adventure works]
WHERE
[Employee].[Employee].&[46]

Run this and you'll see that A Scott Wright has now supposedly got a rank of 1. Whatever the logic behind this, it doesn't make sense from an end user perspective does it?

So how can we explain what's happening here? It's all to do with autoexists: in some cases it makes sense to apply autoexists to named sets, but in others (mostly when the set is intended for use in a calculation) then it doesn't. Let's forget about trying to understand what AS2005 does because it tries to guess when it should apply autoexists and gets very confused, but Katmai is mostly consistent and logical: by default it applies autoexists to all named sets. That explains why queries 2,3 and 4 all return empty sets on Katmai: May and June don't exist with July.

After my initial item on Connect was opened those nice people in Redmond (who agreed with me that the way things were working wasn't ideal) added a new connection string property, Autoexists, which can have the following values:

0 - default (same as 1)
1 - Apply deep autoexists for query axes and named sets (with WHERE clause and subselects)
2 - Apply deep autoexists for query axes and no autoexists for named sets (with WHERE clause and subselects)
3 - Apply shallow autoexists for query axes with WHERE clause, deep autoexists for query axes with subselects, no autoexists for named sets with WHERE clause and deep autoexists for named sets with subselects

Here's the explanation I got from Marius about what's meant by 'deep' and 'shallow' autoexists:

Suppose a query axis or named set involves a set expression of the form F(G(s)), with F and G being set functions (e.g. TopCount, Tail etc.)
Let SSW denote the Where clause slice and Subselect restrictions present in the query.
"Shallow autoexists" evaluates the set expression as Exists(F(G(s)), SSW).
"Deep autoexists" evaluates the set expression as Exists( F( Exists( G( Exists(s, SSW) ), SSW ), SSW) - it applies autoexists with the Where and Subselects at every intermediary step. Deep autoexists applies to all set-valued subexpressions being evaluated in the root context of the query (i.e. the context of default member coordinates, or Where clause coordinates, if a Where clause is present).
For many/most set functions (e.g. Union), the rules above produce the same result.
For others (e.g. TopCount, Head/Tail), the results differ in the general case.

So the behaviour I describe above for RC0 is also what you get when you put Autoexists=1 in the connection string. But what about Query 1 - why does the PeriodsToDate function return July with this setting? Hmm, well I think this is a bug and it should return an empty set. I opened another Connect about this:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=356193
and I'll update this post when I get an answer on it.

What happens with Autoexists=2 and Autoexists=3 then? In both cases, Query 1 returns the set of months from January to June; Query 2 returns June, Query 3 and Query 4 both return May and June. To see the difference between these two settings take a look at this query:

WITH
SET mytestset AS
(
[Date].[Calendar].[Month].&[2004]&[5]
:
[Date].[Calendar].[Month].&[2004]&[6]
)
MEMBER measures.test AS
SetToStr(mytestset)
SELECT
measures.test ON 0
FROM (SELECT
[Date].[Calendar].[Month].&[2004]&[7] ON 0
FROM [adventure works] )

With Autoexists=1 and Autoexists=3 the set here is empty; with Autoexists=2 then it contains May and June.

Categories: mdx

Microsoft BI Conference 2008 session list now posted

You can see the session list for this year's BI Conference here:

http://www.msbiconference.com/pages/tracksandsessions.aspx

Looks good. Hmm, wish I could go to this and PASS, but I just can't justify the expense and the time...

Categories: events

Caching: can there be too much of a good thing?

I was doing some load testing on a cube recently and noticed an interesting thing. When my load tests started, the average query response time was high for the first minute or so, which is reasonable given that all queries were being run on a cold cache; subsequently the average query response time fell dramatically, as you would expect when the cache warmed up. But over a long period (and I was running a lot of queries over several hours) I noticed that the average query response time started creeping up again. Not by a massive amount, it's true, but enough to be noticeable: say a rise from three to four seconds.

Naturally I fired off an email to various people who I thought might help, and as usual Mosha came up with the goods. It turns out he'd noticed the same thing happening on the stress tests that MS run internally but come to the conclusion that it wasn't going to be a problem in the real world. I won't try to repeat too much of the technical detail he gave in case I end up garbling it but essentially there were two reasons why this performance degradation was happening:

  • Most stress tests use template queries into which random parameters are passed. So, for example, I had captured several 'typical' queries with four or five dimensions in the Where clause which in my test I parameterised;I then selected a random member on each of these dimensions to pass in to each query. This resulted in a lot of queries being run which returned no data at all, which in turn meant that the cache filled up with entries in the index that were very small and not much use, which in turn made cache lookups slower. In the real world the proportion of queries that return no data is much smaller.
  • The AS cache is optimised for ad-hoc query patterns, where a user starts in one place then drills down/up, slices, dices and so on, and where the data that a query returns is very closely connected to the data retrieved by the last query that was run. This is very different from randomised queries, which as a result perform worse.

So all in all, it's nothing to worry about. I guess if you had a large cube, lots of users, random query patterns and didn't process your cube very often then it might be a slight problem, but that's a lot of ifs.

As an aside, if you're thinking of doing stress testing I wouldn't waste any time trying to get the AS Stress tool I blogged about here working - I found it a real pain and ended up building my own load test tool in SSIS using an approach similar to my cache warmer package.

Categories: analysis services

PASS Camp Germany 2008

Are you looking for a public MDX course in Europe? I teach private MDX courses (I'm in the process of building a new website with all the details on, now I've left Solid Quality - drop me an email if you're interested in one in the meantime) but I'll also be teaching a 3-day public MDX course at PASS Camp Germany from the 2nd to the 4th of September this year:
http://www.sqlpasscamp.de/default.html

Although the website's in German my session will be in English, and although the event is aimed at the German market I'm sure anyone from anywhere will be more than welcome!

Categories: events

Dynamically generating session calculated members in code with Analysis Services 2008

One problem I come across from time to time is the need to be able to group members on a dimension into buckets, for example if you have a Customer dimension you may want to group your Customers together by age group and run a query that shows sales for the 0-9 age group, the 10-19 age group and so on. If you know what buckets you want then you can simply build this into your dimension in advance by creating another attribute; but what if your users want to be able to change the definition of the buckets themselves from query to query - perhaps they wanted to 5 year age groups rather than 10? I described a bit of a hack you could use on AS2K to do this a while ago, but it doesn't work any more on AS2005 or AS2008 because it uses the unsupported CreatePropertySet function and in any case it was pretty nasty; but the only alternative is to be able to have your client tool dynamically create large numbers of calculated members (one for each bucket) with the appropriate definition and then use these calculated members in your query.

However with Analysis Services 2008 there's now another possibility - you can create a stored procedure that can create calculated members within the current session. The "Analysis Services Personalization Extensions" sample shows off a lot of the new possibilities for server-side coding and Michel Caradec blogged about them a while ago too, but neither show how to create calculated members so I thought I'd put an example up here.

The following class generates the calculated members needed to draw a Lorenz curve (as always please excuse the code - I'm no great C# coder and I just threw it together to make the point):

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;

namespace testdc
{
    public class testdc
    {
        public static void Lorenz(string cubeName, int incr, string setToGroup, string numericValue)
        {
            AdomdCommand cmd = new AdomdCommand();
            try
            {
                //drop set
                cmd.CommandText = "drop set [" + cubeName + "].[Lorenz]";
                cmd.ExecuteNonQuery();
            }
            catch
            {
                //if the set isn't there we'll get an error we can ignore
            }
            StringBuilder s = new StringBuilder();
            s.Append("{");
            //create the calculated member for the total of the set
            //try to drop the member first, in case it exists
            try
            {
                cmd.CommandText = "drop member [" + cubeName + "].measures.LorenzTotal";
                cmd.ExecuteNonQuery();
            }
            catch
            {
                //if the member isn't there we'll get an error we can ignore
            }
            cmd.CommandText = "create member [" + cubeName + "].measures.LorenzTotal ";
            cmd.CommandText += "as aggregate(" + setToGroup + " , " + numericValue + ")";
            cmd.CommandText += ", visible=false;";
            cmd.ExecuteNonQuery();
            //create the calculated members for the Lorenz curve
            for (int i = incr; i <= 100; i += incr)
            {
                //try to drop the member first, in case it exists
                try
                {
                    cmd.CommandText = "drop member [" + cubeName + "].measures.Lorenz";
                    cmd.CommandText += i.ToString();
                    cmd.ExecuteNonQuery();
                }
                catch 
                {
                    //if the member isn't there we'll get an error we can ignore
                }
                cmd.CommandText = "create member [" + cubeName + "].measures.Lorenz"; 
                cmd.CommandText +=  i.ToString();
                cmd.CommandText += " as aggregate(bottomcount(" + setToGroup ;
                cmd.CommandText += ", count(" + setToGroup + ") * " + i.ToString() + "/100 , ";
                cmd.CommandText += numericValue + "), " + numericValue + ")/measures.LorenzTotal";
                cmd.CommandText += ", visible=false, format_string='percent';";
                cmd.ExecuteNonQuery();
                s.Append("measures.Lorenz" + i.ToString() + ",");    
            }
            s.Append("{}}");
            //Create set containing all the calculated members
            cmd.CommandText = "create hidden set [" + cubeName + "].[Lorenz] as " + s.ToString();
            cmd.ExecuteNonQuery();
            cmd.Dispose();
        }
    }
}

You need to call the as follows:

call
testdc!Lorenz(
//The name of the cube you're using
"Adventure Works",
//The % increment for each grouping member
//For example, 5 will result in 100/5=20 members
5,
//The set to group
"[Customer].[Customer].[Customer].Members",
//The measure to use
"[Measures].[Internet Sales Amount]")

When it executes it creates a number of calculated members (the exact number depends on the second parameter) and a named set called [Lorenz] with them all in. Having done that you can run a query and request all the members in the named set:

select [Lorenz] on 0 from [adventure works]

You can call the sproc many times in the same session with different parameters and it should always work, although I'll admit it could do a better job of dropping old calculated members. It would also have been able to create a function that did much the same thing but which returned a set containing all these calculated members, so you could call it direct from your query and not have to call the sproc beforehand, but I couldn't get that to work unfortunately.

Categories: mdx

PASS 2008 Summit

A while ago I blogged about making the decision on whether to attend the Microsoft BI Conference or PASS. Well, the decision has been made for me: I forgot to submit a session abstract for the BI Conference but got my session accepted for PASS, so it's PASS I'm going to. You can see all the content on the BI track at PASS here:
http://summit2008.sqlpass.org/program-sessions.html#business
I've never been to one of the big PASS summits in the US before so it'll be quite exciting.

My session is called "Creating an SSIS, SSAS and SSRS Monitoring Solution with SSIS, SSAS and SSRS" - basically how to build a BI solution that allows you to capture and analyse the performance and usage of your BI solution using your favourite Microsoft BI tools. It's a topic that people have tackled bits of in the past but I want to be a bit more ambitious and demo a full, end-to-end solution. If anyone has any thoughts or tips to offer on what I should be showing then please leave a comment!

Meanwhile I see that the Microsoft BI Conference still hasn't published its agenda. To me this is poor marketing - how can you make a decision to attend a conference without seeing the agenda? It's like going into a restaurant without seeing the menu.

Categories: events

Policy-based management almost makes it to AS2008

I was using SQLMS with AS2008 the other day and noticed when right-clicking on the server node in the Object Explorer window some policy-based management options seemed to be available:

policy

Now policy-based management is one of the new features of the relational engine in SQL2008; you can read more about it here:
http://www.mssqltips.com/tip.asp?tip=1492

For a moment I was excited, then I took a look at what facets were actually available for Analysis Services: there's only one, and that gives you the same options to set as you got in the old Surface Area Configuration tool. Maybe in a future release we'll get some more functionality - it would be great to be able to enforce policies like "Always associate a partition with an aggregation design" and so on.

Categories: none

SQLBits III Call for Speakers

Yes, it's time for yet another SQLBits! SQLBits III (aka SQLBits Cubed) will be taking place on Saturday September 13th at the de Havilland Conference Centre in Hatfield, and we are looking for sponsors and speakers.

If your company is interested in sponsoring SQLBits, please drop an email to Tony Rogerson at tonyrogerson@torver.net and he'll send you a sponsor pack. With over 300 SQL Server professionals attending the last two conferences, if you've got a SQL Server-related product or service to sell then SQLBits sponsorship is a great way of reaching your target audience. Remember, it's only through sponsorship that we can keep SQLBits going as a free event!

If you're interested in speaking on any SQL Server related topic (and that includes BI - SSAS, SSRS, SSIS, or PerformancePoint), then you can submit a session on the SQLBits site here:
http://www.sqlbits.com/information/sessionsubmission.aspx

The session submission deadline is July 4th. We actively encourage new speakers, so if you've never presented a session at a conference before but it's something you think you'd like to do, then why not give it a try? If you've got any questions, drop Allan Mitchell an email on allan.mitchell@konesans.com

Categories: events

Interview on the SQL Down Under Show

For your listening pleasure: the latest edition of the SQL Down Under Show is me talking to Greg Low about MDX and Analysis Services. You can download it here -

http://www.sqldownunder.com/PreviousShows/tabid/98/Default.aspx

Categories: on the internet

Using the Caption property with Calculated Members in AS2008

One of the many minor improvements in AS2008 MDX is the ability to specify a separate caption for calculated members. Vidas already did a good writeup of the other new properties that you can specify on calculated members, but for me the ability to specify captions is interesting because we should really be setting captions on calculated members as a matter of best practice.

First, how does it work? Well, it's very straightforward - here's an example query and output:

calccaptions

You can see that although we've declared a calculated measure whose unique name is measures.test, when the query is run the end user sees the caption "This is a test measure". Note you have to use a hard-coded string as a caption, you don't seem to be able to use an MDX expression.

But why should we be doing this? Because calculated member captions are something that change quite often, especially during development, and if you don't use the caption property then you'll end up having to change the unique name of the calculated member all the time - and this of course will break any other calculations in the MDX Script that refer to this calculation, and worse it will also break any existing queries in reports that refer to this calculation. Also since calculated member captions can be quite long, the ability to write MDX expressions that refer to a much shorter unique name means your code will be much more concise and readable.

Of course with real members on non-measures dimensions, if you have specified different columns for the Key and Name properties of the attribute hierarchy you already get this separation between the unique name of the member and the caption that the user sees. The only missing bit of functionality now is a separate Caption property for real (as opposed to calculated) measures.

Categories: mdx

BI Survey 8

Is it that time of year again? Yes, here's the link for the latest BI Survey:
http://www.eu-survey.com/BI_8/BI.asp?lan=1&lin=23

Here's the blurb:

We would very much welcome your participation in The BI Survey, conducted annually by Nigel Pendse. This is the largest independent survey of OLAP users worldwide. The Survey will obtain input from a large number of organizations to better understand their buying decisions, the implementation cycle and the business success achieved. Both business and technical users, as well as vendors and consultants, are welcome.

The BI Survey is strictly independent. While vendors assist by inviting users to participate in the Survey, the vendors do not sponsor the survey, nor influence the questionnaire design or survey results. You will be able to answer questions on your usage of a BI product from any vendor. Your data will only be used anonymously, and no personal details will be passed to vendors or other third parties.

As a participant, you will not only have the opportunity to ensure your experiences are included in the analyses, but you will also receive a summary of the results from the full survey. You will also have a chance of winning one of ten $50 Amazon vouchers.

Categories: on the internet

Connection String Properties in SQLMS RC0

I heard this was going to be possible back in March, but now I've seen it in RC0 - you can now set connection string properties in SQL Management Studio when opening an MDX query window. Just click the new MDX query button, then click Options and you'll see a third tab:

connectionstrings

Although it's much less common to need to set connection string properties, there are still a few scenarios where it's useful. One example is the 'Cube' connection string property, which allows you to write session scoped script assignments in the way Mosha does here:
http://sqlblog.com/blogs/mosha/archive/2008/06/08/mdx-answer-to-nextanalytics-challenge.aspx

Another good example is when you're using the Roles or EffectiveUserName properties to test out how queries behave with security.

Categories: analysis services

BI Evening July 17th

There's going to be another one of the UK SQL Server Community's BI Evening events happening at Microsoft UK's offices at TVP in Reading on the evening of July 17th. It's been far too long since the last one, I know - we've all been a bit distracted by SQLBits (and there's going to be another one of those on September 13th - do you or our company want to sponsor it?).

You can sign up here:
http://www.sqlserverfaq.com/

Here's what we've got lined up:

"PEL vs MDX - what are the differences between the two languages?"
Jeremy Kashel, Adatis

Jeremy Kashel from Adatis presents an introduction to the PerformancePoint Expression Language (PEL). The content will be geared towards MS BI developers, and will highlight the differences between PEL and MDX, with the aim that those with MDX experience will be able to make a fast start with PEL

"Using Excel Services with Analysis Services and MOSS"
Jeremy Kirkup, TAH

If you are just starting to explore delivering BI solutions with Excel Services and Sharepoint then there are some issues that it is wise to be aware of in advance. This session will describe some real world lessons gained while creating BI solutions which expose Analysis Services data through the Excel Web Access web part.
The Excel 2007 client has first class support for the some of the advanced features of Analysis services such as drill-through. However, when exposing pivot tables to a browser through the Excel Web Access web part this feature is not available. The session will discuss a couple of approaches to implementing drill-through functionality for EWA based pivot tables using the MOSS SmartPart, AJAX and the Excel Web Services.

Categories: none

SQL Server 2008 RC0 is out

Andrew Fryer has the details here:
http://blogs.technet.com:80/andrew/archive/2008/06/06/sql-server-2008-rc0.aspx

If we've got a release candidate, then this means RTM isn't too far away...

Categories: analysis services

Google Powerapps

While Jamie (who I saw through a window today, although I didn't manage to say hello) is wondering about whether SQL Server Data Services will ever include a cloud-based OLAP engine, Panorama have just announced their own equivalent called Panorama PowerApps:
http://www.panorama.com/blog/?p=111
http://panorama.com/powerapps/

And guess what, it's queryable through MDX! That means that not only will you be able to query it through Google Apps but also Excel. I've signed up to be a beta tester, so I'll blog more when I have a chance to check it out.

Oracle and MDX

Meanwhile, in the parallel universe inhabited by Oracle users, a few weeks ago Mark Rittmann interviewed the architect for Oracle Business Intelligence Enterprise Edition, Phil Bates, and asked readers to suggest some questions for him. Of course I couldn't resist asking about MDX, even though I got a very nondescript response:
http://www.rittmanmead.com/2008/06/04/phil-bates-answers-your-questions/

Interesting that many of the other questions concerned data access (eg "Will Oracle reverse Hyperion's undocumented strategy for making it almost impossible to get data out of Essbase successfully?") as well.

Categories: mdx

nextanalytics

Hands up who remembers OLAP@Work? If you do you've been working with Analysis Services for a long time, back when it was still OLAP Services... for those of you who don't, it was one of about four options you had if you wanted a client tool circa 1999; it was an Excel addin and it was pretty good. Anyway, I've just seen this article on Intelligent Enterprise on what Ward Yaternick, the guy who founded OLAP@Work, has been up to since leaving Business Objects (which bought and eventually killed OLAP@Work):
http://www.intelligententerprise.com/blog/archives/2008/06/bi_innovation_f.html

He's been working on something called nextanalytics:
http://www.nextanalytics.com/

Poking around on the site it looks quite interesting; certainly there are lots of mentions of MDX so I guess it supports Analysis Services as a data source (although it supports a lot of other data sources too). The key thing is that it allows you to create complex queries and calculations using a scripting language. Clearly this scripting language allows you to do the same kind of things you can do with MDX and indeed one particular entry on the nextanalytics blog caught my eye:
http://www.nextanalytics.com/component/option,com_myblog/Itemid,342/show,Can-a-business-intelligence-product-be-used-to-answer-analytic-questions-.html/

I was about to leave a comment when I saw that Mosha had beaten me to it. Mosha's right that contrary to what the original entry says, what Ward is describing is certainly possible in MDX, but Ward also has a point that it's not something that someone with an average knowledge of MDX could accomplish. Can nextanalytics prove itself to be easier to use than MDX? Time will tell. I'll have to download the open source version of it (available here: http://www.codeplex.com/nextanalyticsOS) to try it out. When I have a spare moment, of course, which at the current rate is going to be some time next year.

Categories: client tools

IBM Cubing Services and MDX support

Via Amyn Rajan of Simba Technologies, I see that IBM's Cubing Services OLAP tool now supports OLEDB for OLAP:
http://blogs.simba.com/simba_technologies_ceo_co/2008/05/ibm-cubing-serv.html

Another boost for the MDX language then! It's the lure of Excel compatibility that is driving all this of course, but it also opens the way for other MDX-friendly client tools as well.

Meanwhile MDX support is also proceeding in other, less direct ways. I mentioned before here that I hoped some of the new breed of data warehouse appliance vendors would start to support MDX as well and in a way it's starting to happen: Vertica and Pentaho announced a partnership a few months back and I've already heard of one instance of a company using Mondrian on top of Vertica. Hopefully other vendors will begin to realise that raw query performance is not much use unless matched with a language that allows you to easily express the queries and calculations you need.

Categories: mdx

LINQ to MDX

Seeing that Marco Russo has released his book "Programming Microsoft LINQ" reminded me of a conversation I had with him a while ago about something I've heard various people ask about over the last year - will there be a LINQ to MDX?

Before we go on, I should state that it's my opinion that there isn't a big enough market out there for anyone (Microsoft or a third party) to justify spending time developing LINQ to MDX. That's not to say that I wouldn't want to see it - I would - just that I doubt anyone much would use it. MDX remains too much of a niche language, and off-the-shelf tools work well most of the time so there's less need to write custom MDX-generation code. As far as I know Microsoft isn't planning on developing LINQ to MDX and I'd be surprised if it ever did, so this will remain a theoretical discussion.

But for the sake of argument if you were to implement LINQ to MDX the main problem you'd have to tackle would be the same one you have with using MDX in Reporting Services and Integration Services: MDX can't guarantee fixed column names for any given query. However I had an idea on how to avoid this, and that is to think in terms of LINQ to MDX sets rather than LINQ to MDX queries. So for example if you take the following SQL query on a dimension table:

Select Year, Quarter, Month
From TimeDim
Where Year=2008 and (Month=March or Month=April)

that would then translate easily into the following MDX set expression:

{([TimeDim].[Year].[2008], [TimeDim].[Quarter].[Q3], [TimeDim].[Month].[March]), ([TimeDim].[Year].[2008], [TimeDim].[Quarter].[Q3], [TimeDim].[Month].[April])}

MDX sets have to be made up of tuples containing the same dimensionality, and if you think of a set's dimensionality in terms of columns in a SQL SELECT statement then you can see how that might map onto LINQ concepts. Instead of using LINQ to create an MDX SELECT statement directly, you'd use LINQ to create MDX sets and then pass all of these sets into another function which would then run the query using the sets created as axes.

Since I'm no LINQ expert this was the point where I dropped a mail to Marco to ask him his opinion; he thought it was feasible and even came up with an idea of what the code might look like in C#:

var timeSet = from period in cubeBudget.TimeDim.Members
where period.Year == 2008
&& (period.Level == TimeDim.Level.Year
|| period.Month == "March"
|| period.Month == "April" )
select period;

Var measures = from measure in cubeBudget.Measures
Where new string[] { "Sales", "Quantity", "Price" }.Contains( measure.Name )
select measure;

Var query = from measure in measures
from period in timeSet
select new { period.Name, measure.Name, measure.Value };

var cellset = from cell in cubeBudget
where cell.Columns( measures )
&& cell.Rows( timeSet )
select cell;

In the code above, timeset would define the set of members on the Period dimension you wanted to use and measures would return the set of measures. Then you could use them in two ways: query would return a flattened rowset and cellset would return a cellset. But this all seems very convoluted and probably just as confusing to the average developer as raw MDX.

Another alternative approach would ignore MDX altogether and query Analysis Services using SQL directly (see http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!751.entry for more details on this topic), although I'm sure you'd run into the limitations of the SQL that is supported very quickly and in any case you lose all of the flexibility and functionality of the MDX language when you do this.

Maybe if we're looking for a way to programmatically generate MDX then LINQ isn't the way to do it. It's something olap4j is working towards and they have taken an approach that is much more in tune with the multidimensional nature of MDX. One of the 'open issues' that caught my eye in the section of the olap4j spec that deals with this functionality is the question "Is this API at the right level, or is it too close to MDX?", meaning I guess that it would be all too easy to come up with an interface that is just as complex as MDX itself. Where would you draw the line between ease-of-use and functionality? Is it the MDX language that is confusing for people, or the multidimensional concepts (concepts that any interface would have to reflect) that underpin it? Can you abstract MDX to an interface to make it easier to use? I wish I knew more Java so I could test drive olap4j - is there anyone reading this who is using it? As always, I'd be interested to hear anyone's thoughts on this matter so please leave some comments...

Categories: mdx

Cell Security: when Read permissions are actually Read Contingent

I usually avoid using cell security like the plague for the good reason that it absolutely kills query performance. But sometimes there's no alternative but to use it and I'm working on one such project right now. However I've found a new gotcha: the behaviour of cell security changed between AS2005 SP1 and SP2 and in my opinion it didn't change for the better. The short explanation is that when you are using just Read permissions in cell security, if you have MDX Script assignments at a lower level of granularity you'll find that the higher level members whose values are affected by the assignments have Read Contingent permissions applied to them, even though according to the MDX expression I used in for the Read permissions these values should not be secured.

Here's the repro I've got for Adventure Works using AS2005 SP2:

  • In AW, comment out everything in the MDX Script apart from the Calculate statement
  • Add the following calculations to the Script:
    CREATE MEMBER CURRENTCUBE.MEASURES.[Show Value] AS
    IIF(
    [Date].[Calendar].CURRENTMEMBER IS
    [Date].[Calendar].[Month].&[2004]&[1],
    FALSE, TRUE);

    CREATE MEMBER CURRENTCUBE.MEASURES.[Show Internet Sales Amount] AS [Measures].[Internet Sales Amount];
  • As an Administrator you see the following results for a query in the cube browser:
    clip_image001
  • Now create a role with the following Read permissions in the cell security tab:
    IIF(
    [Date].[Calendar].CURRENTMEMBER IS
    [Date].[Calendar].[Month].&[2004]&[1]
    AND
    [Measures].CURRENTMEMBER IS [Measures].[Internet Sales Amount],
    FALSE, TRUE)
  • Display the same query in the browser when connecting through this new role, and as expected you see the following:
    clip_image002
  • Now add the following assignment to the MDX Script:
    ([Date].[Calendar].[Month].&[2004]&[8])=[Date].[Calendar].[Month].&[2004]&[7];
  • And refresh the query, so you see this:
    clip_image003
  • The big change is that the value for CY2004 and the All Member are now secured too. So we're now in the situation where we've made an assignment that displays a value that wasn't secured anyway, but we now can't see the CY2004 value even though the expression in the Read permissions returns true. If you were to change the assignment so it refers to the value for January 2004, as follows:
    ([Date].[Calendar].[Month].&[2004]&[8])=[Date].[Calendar].[Month].&[2004]&[1];
    You can see the January value either while looking at August or the ‘Show Internet Sales Amount' calculated measure, as I would expect, because neither are aggregated from anything and the expression for the Read permission always returns True for them:
    clip_image004

For my customer, who is migrating from AS2005 SP1 direct to Katmai, this is potentially a major problem. And to be honest as my repro shows I don't think this new behaviour makes any sense at all anyway - if I wanted to use Read Contingent permissions I'd have used Read Contingent permissions!

Categories: analysis services

SqlSpec

I've just come across SqlSpec from Elasoft (http://www.elsasoft.org/) a tool that can create documentation for Analysis Services databases. You can see some sample output here:
http://www.elsasoft.org/samples.htm

I've downloaded it and given it a quick try, and it seems to do the job pretty well. This is the second documentation tool for SSAS that I'm aware of, the other being BI Documenter. Which one is better? Well I guess it depends on what you want to do since the two tools support different data sources and have slightly different features (http://www.elsasoft.org/compare.htm vs http://www.bidocumenter.com/Public/Features.aspx). You can see sample output for BI Documenter here:
http://www.bidocumenter.com/Public/SampleOutput.aspx

You pays your money, you takes your choice...