so what is a SAS OLAP N-WAY anyway?

0

Posted on : 01-07-2011 | By : Ben Stinner | In : Analytics

In SAS OLAP the N-WAY summarization is created by default, however you have the option to not create the N-WAY as I highlighted in a prior post, not creating it changes your OLAP type to either a HOLAP or ROLAP. But the real question is what the heck is this N-WAY thingy anyhow? For new SAS programmers this is probably a new term, but for SAS PROC SUMMARY and MEANS users this is ol’ news. (In the SAS OLAP Documentation, it is actually stated that these two procedures were where the N-WAY term came from.)

The N-WAY option simply provides the lowest level summary of data. So by default, OLAP creates an N-WAY to house the lowest level of measures at ALL dimensional/hierarchy crossjoins.

 

If you have 3 dimensions – geography, product, business unit
with several levels within  – state/city, color/size/name, organization/department
and measures of              -  sales sum, returns sum, inventory sum

The N-WAY is the total sum of sales, returns and inventory at the cross join of all levels:
state-city-color-size-name-organization-department.
Such as:

In a report, if you’d like to see the total sales by city and organization, SAS takes the nway and on-the-fly sums up the ‘lower’ level data at the departments (as well summing up the product dimension) to give you the totals.
Such as:

Article source: http://feedproxy.google.com/~r/RealBusinessIntelligenceForRealUsers/~3/v8CHiCch0sI/so-what-is-sas-olap-n-way-anyway.html

  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?
  • wp socializer sprite mask 16px so what is a SAS OLAP N WAY anyway?

The Billion Pound-O-Gram Redesigned

0

Posted on : 01-07-2011 | By : Ben Stinner | In : Analytics

I was recently asked my opinion of David McCandless’ chart “The Billion Pound-O-Gram,” pictured below.

cc1b2 billion pound o gram small The Billion Pound O Gram Redesigned
Click to enlarge.

The person who asked the question was impressed with this chart the first time he saw it. For this reason, he thought that I might find it an effective exception to McCandless’ other work. I do not.

This chart originally appeared in the Guardian on November 7, 2009. It was framed by the following explanation:

Huge sums of money are being bandied about and no-one knows what they are. It’s time to put them into perspective.

289 billion spent on this. 400 billion spent on that. When money reaches this level it literally becomes mind-boggling.

Yet these figures are regularly issued by the government – and the media – as if they are self-evident facts that everyone understands.

Frustrated by this, I created The Billion Pound-O-Gram.

I’ve mixed up of 2008/09 figures from the Treasury and the Guardian. Visualising the numbers like this puts them in visual context, making them easier to relate to.

I was pretty shocked by the size of the UK budget deficit – essentially the country’s overdraft. It’s more than an entire year’s worth of income tax.

A second chart appeared following this explanation to illustrate how the “top five ideas for plugging the deficit” offered by political parties in the UK might reduce it. To sum up, the story is that the UK’s budget deficit is really big, which McCandless tells by comparing it to other amounts of money with which readers of the Guardian are presumably familiar. The question that concerns us here is, “Does this chart tell the story effectively?” Does it put the budget deficit into perspective in a way that doesn’t boggle the mind as McCandless suggests? This is journalism, so the objective is to inform, to help readers clearly understand the size of the deficit.

By using rectangles of varying sizes arranged as a treemap of sorts, McCandless forces us to perform a perceptual task that we can’t do well (that is, area comparisons). This is a bad choice when he could have used a bar graph instead and allowed us to compare the lengths of bars that share a common baseline, which we can do exceptionally well. Furthermore, his arrangement of the rectangles is arbitrary—not based on category or on the sizes of values—which compounds the difficulty.

To better understand what I’m saying, try to answer the following questions without reading the numbers that appear in the rectangles:

  • Which represents a larger amount: Mortgage Lending 2007 or NHS?
  • How much greater is Mortgage Lending 2007 than State Pensions?
  • Does State Pensions compared to Tesco Revenue look like the difference between 62 and 59, or much greater?
  • Which is bigger: Income Support or Police?

You might argue that these comparisons aren’t critical to the story, which is primarily about the budget deficit. If we concern ourselves only with comparing the deficit to other values, nothing about the chart’s design makes this easy, even when items are adjacent to one another. For instance, try answering the following questions:

  • How much greater is the deficit than Africa’s entire debt to Western nations, which appears immediately below it? (And don’t cheat by reading the numbers.)
  • How much greater is “Bailout: Asset Purchasing and Lending” than the deficit?
  • How does Income Tax compare to the deficit?

Without reading the numbers, you’re forced to make wild guesses, which are considerably different from the truth, which could have been presented clearly.

All of these comparisons are incredibly simple to make using the bar graph below. Take a minute to notice how easy it is to see the relationships between these values from largest to smallest and to compare them. Notice especially how easy it is to compare each of the values to the budget deficit, which appears as the vertical black reference line.

68cf8 redesign of billion pound o gram small The Billion Pound O Gram Redesigned
Click to enlarge.

In the bar graph, I stuck with the colors that McCandless chose to make it easy to compare his chart to mine, except that I tweaked a few colors a bit to resolve minor problems. In McCandless’ chart, some colors stand out more than others, but they should be equal in salience unless there’s a reason to feature some items over others. Also, for some unknown reason McCandless sometimes altered a single color from rectangle to rectangle, which serves no purposes and creates potential confusion. For example, notice that some of the green rectangles are lighter than others, yet they all represent “Earning.”

I can’t imagine anyone seriously arguing that McCandless’ chart communicates this information as well as the alternative above, but is his chart more engaging? Some folks might find it more engaging purely on the level of entertainment, but not in a way that encourages or supports meaningful consideration of the information, resulting in optimal understanding. Journalism should tell the story truthfully and clearly.

Take care,

1a6d3 Signature The Billion Pound O Gram Redesigned

Article source: http://www.perceptualedge.com/blog/?p=1030

  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned
  • wp socializer sprite mask 16px The Billion Pound O Gram Redesigned

It just works–but why?

0

Posted on : 01-07-2011 | By : admin | In : Analytics

One of the things that often confuses people when they learn MDX is the way that certain queries seem to work without them understanding why. This is because MDX tries to be helpful – and I would say too helpful – in correcting your mistakes for you by applying functions to objects, and casting objects to other objects, without you knowing to avoid raising an error. This might seem like a useful thing to do but in the long run I think it stops people getting a proper grasp of how MDX actually works, and reinforces the habit of ‘hack the statement until it works’ that some people have.

Let’s look at a couple of examples. First of all, in a SELECT statement, the way we define what appears on rows or columns is to use an expression that returns a set object. Now look at the following query:

SELECT
[Measures].[Internet Sales Amount]
ON COLUMNS,
[Date].[Calendar].[Calendar Year].[2003]
ON ROWS
FROM [Adventure Works]

It executes just fine, but what we’ve put on rows and columns is in each case just a member. SSAS is expecting a set but is casting each member to a set with that one member in it, ie

SELECT
{[Measures].[Internet Sales Amount]}
ON COLUMNS,
{[Date].[Calendar].[Calendar Year].[2003]}
ON ROWS
FROM [Adventure Works]

Now the problem with the former is that as soon as you want to put more than one member on an axis, eg

SELECT
[Measures].[Internet Sales Amount], [Measures].[Internet Tax Amount]
ON COLUMNS,
[Date].[Calendar].[Calendar Year].[2003], [Date].[Calendar].[Calendar Year].[2004]
ON ROWS
FROM [Adventure Works]

The query errors with one of MDX’s famously unhelpful error messages:

Parser: The statement dialect could not be resolved due to ambiguity.

In this case it now can’t tell whether this is a SQL query or an MDX query (and yes, you can query SSAS with SQL) and so it fails; you now need to add those braces that should have been there in the first place:

SELECT
{[Measures].[Internet Sales Amount], [Measures].[Internet Tax Amount]}
ON COLUMNS,
{[Date].[Calendar].[Calendar Year].[2003], [Date].[Calendar].[Calendar Year].[2004]}
ON ROWS
FROM [Adventure Works]

There are numerous other examples. This query returns all Calendar Years on rows:

SELECT
{[Measures].[Internet Sales Amount]}
ON COLUMNS,
[Date].[Calendar].[Calendar Year]
ON ROWS
FROM [Adventure Works]

Even though, in the row axis definition, you’re supplying a level object: [Date].[Calendar].[Calendar Year] . What SSAS is doing here is secretly applying a function to the level object you’ve given it to get the set object that it actually needs, and that function is the .MEMBERS function. So what’s actually happening is this:

SELECT
{[Measures].[Internet Sales Amount]}
ON COLUMNS,
[Date].[Calendar].[Calendar Year].MEMBERS
ON ROWS
FROM [Adventure Works]

However, when you supply a hierarchy object on rows instead:

SELECT
{[Measures].[Internet Sales Amount]}
ON COLUMNS,
[Date].[Calendar]
ON ROWS
FROM [Adventure Works]

You only get the All Member returned, so we’re not getting the .MEMBERS function being applied here (if we were, we’d get every member from every level of the Calendar hierarchy). What we’re actually getting back is the default member – but from which function? It’s actually the .CURRENTMEMBER function, as far I can see, so what’s actually happening is this:

SELECT
{[Measures].[Internet Sales Amount]}
ON COLUMNS,
{[Date].[Calendar].CURRENTMEMBER}
ON ROWS
FROM [Adventure Works]

To prove this, if you run this query with the hierarchy object being used in a calculated measure:

WITH
MEMBER MEASURES.TEST AS
MEMBERTOSTR([Date].[Calendar])
SELECT
{[Measures].[Internet Sales Amount], MEASURES.TEST}
ON COLUMNS,
[Date].[Calendar].MEMBERS
ON ROWS
FROM [Adventure Works]

…you can see the output of the calculated measure varies by row:

9bfc4 image thumb7 It just works–but why?

Whereas if the function being applied here was, say, the .DEFAULTMEMBER function, we’d always get the default member being returned here.

I could go on, but the real point to make here is that relying on SSAS to fix your mistakes for you is a bad thing. Whenever I write MDX I always try to be as ‘correct’ as possible to help me (and whoever needs to maintain the code after me) understand exactly what’s happening as easily as possible; it’s as important as commenting the code properly in my opinion. And if you’re learning MDX, be curious: if something works but you don’t understand why, take some time to understand it; just think what problems you’ll have when something doesn’t work and you don’t understand why!

Article source: http://feedproxy.google.com/~r/wordpress/Cpjz/~3/VGFN_M6K06U/

  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?
  • wp socializer sprite mask 16px It just works–but why?