williamweber.net
  • Home
  • About
  • Minnebar 2013 Wrap-Up

    Last Saturday I attended my first Minnebar, a local BarCamp style event for technology geeks of all shapes and sizes here in the Twin Cities. My original goal was to attend a [...]

    Read more
  • Thoughts on Killzone 3 Multiplayer Go...
    killzone3

    A few days ago I read that Killzone 3 would be offering up it’s multiplayer component free of charge with progress limitations and a $15 price tag to acquire the full e [...]

    Read more
  • A Game Funding Revolution
    A Game Funding Revolution

    Earlier this month the game Double Fine (the development studio headed by Tim Schafer) started a Kickstarter project with the goal of developing a classic point-and-click adv [...]

    Read more
  • Named Set Sub-totals in Excel using V...
    Named Set Sub-totals in Excel using VisualTotals()

    This is just a quick tip for fixing the default Analysis Services (SSAS) named set sub-total behavior in Excel 2010. Normally when you select a named set for the rows or colu [...]

    Read more
  • New Camera Please. – Mirrorless...
    Olympus OM-D E-M5

    A few years ago my wife and I upgraded our intro-model DSLR camera for a mid-range one (Nikon D60 to the Nikon D90). We’ve really enjoyed the camera and looking at our [...]

    Read more
  • Formatting Map Legends in SQL Server ...
    Formatting Map Legends in SQL Server 2008 R2 Reporting Services

    Recently I needed to do some slightly more advanced formatting of a map legend in SQL Server 2008 R2 Reporting Services (SSRS). I love the map reports you can build with SSRS [...]

    Read more
  • MDX: Scope Statement For All Measures...

    This was irritating me today so I thought I would share. If you need to write a scope statement that will include all the measures in multiple measure groups; perhaps youR [...]

    Read more
  • Startup Frenzy Is Out of Control

    A recent, and refreshingly brief, article over on Business Insider about the inexplicable amount of hype that tech media lavishes on startup funding crystallized what’s [...]

    Read more
  • The Building Windows 8 Blog is Amazin...

    Wow! The Building Windows 8 blog is amazing. And the most recent post, Reflecting on your comments on the Start screen, in which they respond to a number of the comments abou [...]

    Read more
  • My iPad Must Have App List

    I was recently asked for a list of apps I would recommend for the iPad. I decided to do it up right, with links and some brief commentary and post it on the blog. Seemed the [...]

    Read more

Posts tagged BI

Named Set Sub-totals in Excel using VisualTotals()

Feb22nd
2012
Leave a Comment Written by Will

This is just a quick tip for fixing the default Analysis Services (SSAS) named set sub-total behavior in Excel 2010. Normally when you select a named set for the rows or columns of a pivot table you don’t get a sub-total. Which, for me, removes a lot of the usefulness of the named set. Thankfully it’s a relatively easy fix. It just takes a little additional MDX in your named set definition.

Enter: VisualTotals() (msdn function reference)

The VisualTotals() function dynamically totals child members in a set. By adding the “All” member for whatever hierarchy you’re building your set from and wrapping the whole set in the VisualTotals() function you can get Excel to treat the named set just like any other group/hierarchy when it comes to sub-totals.

Typically if you created a set like this one (all examples from Adventure Works):

WITH SET [Amasia] AS
{
	[Geography].[Country].&[United States]
	,[Geography].[Country].&[Canada]
	,[Geography].[Country].&[Australia]
}

You’d see something like this:

no sub-totals

If instead you create your set like so:

WITH SET [Amasia] AS
VisualTotals(
	{
		[Geography].[Country].[All Geographies]
		,[Geography].[Country].&[United States]
		,[Geography].[Country].&[Canada]
		,[Geography].[Country].&[Australia]
	}
)

You’ll get a nice little sub-total at the bottom.

Yey! sub-totals

One thing to note is that you need to put the “All” member at the beginning of your VisualTotals set. Otherwise it won’t be correctly filtered by the children that follow and you’ll end up with a sub-total that is actually the full, unfiltered total of the “All” member.

MDX, Scripts, SSAS
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Recent Posts

  • Minnebar 2013 Wrap-Up
  • Thoughts on Killzone 3 Multiplayer Going Free-to-Play (or is it Free-to-Pay?)
  • A Game Funding Revolution
  • Named Set Sub-totals in Excel using VisualTotals()
  • New Camera Please. – Mirrorless ILC Goodness

Categories

  • BI
  • Gaming
  • Opinion
  • Photography
  • Reporting
  • Scripts
  • Social Games
  • SQL Server
  • XNA

Archives

  • April 2013
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • April 2011
  • January 2011
  • December 2009
  • July 2009
  • April 2009

EvoLve theme by Theme4Press  •  Powered by WordPress williamweber.net