Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SSAS 2005 – Named Sets – TopCount – Static/Dynamic and Ordering

Named Sets in SSAS 2005 (SQL Server Analysis Services 2005) are a good thing. You can set up named sets for things like “Last 3 months” or “Yesterday” which is really nice for end users. The nature of dates is that you can make the MDX dynamic but yet the named set is still “static”.

You can also create sets when running MDX queries, and use them later in queries you run. These are dynamic named sets. The problem is, when you are working on your cube, you cannot define dynamic named sets in the “Calculations” tab. The named sets there are static. If you try to define a named set that say, for instance, tries to get the “Top X Salespeople by Revenue” or something, you can create it, but what happens is when you deploy your cube, the named set gets run for one slice of the cube, usually just the default (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=817566&SiteID=1   and http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1304964&SiteID=1).

I did read on a site, that in SSAS 2008, you will be able to create dynamic named sets in the cube editor, so that is good.

One other thing with named sets, if you create a named set that is using TopCount, when you bring it into an Excel pivot table, you will see the Top X values you are looking for (sliced incorrectly, as I stated above, but still there). Thing is, they are sorted by the SET Expression, not the Numeric Expression. I haven’t found a way to get them to sort by the numeric expression. Example from above, you have the Top 3 Salespeople by Revenue. You want to see that sorted by revenue. If you run a MDX query using TopCount

SELECT
{[Measures].[Revenue]} ON COLUMNS,
{TOPCOUNT([Employees].[Salespeople].MEMBERS,3,
    [Measures].[Revenue])} ON ROWS
FROM
    [MyCube]

you will see it ordered in the query results correctly

John Smith           $1000
Amanda Jones      $950
Homer Simpson     $500

etc

Now if you take the TopCount out –

TOPCOUNT([Employees].[Salespeople].MEMBERS,3,
    [Measures].[Revenue])

and create a named set in your MDX Script of the cube editor

CREATE SET CURRENTCUBE.[Top 3 Salespeople by Revenue]
 AS TOPCOUNT([Employees].[Salespeople].MEMBERS,3,[Measures].[Revenue]) ;        

or even like this as the forums above say

CREATE SET CURRENTCUBE.[Top 3 Salespeople by Revenue]
 AS TOPCOUNT(Existing [Employees].[Salespeople].MEMBERS,3,[Measures].[Revenue]) ;  

When you pull that named set into your pivot table in Excel, they wont be ordered by Revenue, instead, by name

Amanda Jones      $950
Homer Simpson     $500
John Smith           $1000

Funky stuff. My recommendation – if you are going to be needed dynamic named sets like the ones created above, just create a SSRS (SQL Server Reporting Services) report instead, or wait until SSAS 2008 comes out.

Note:

Now, the above is just what I have found. There might some crazy way that I am unsure of in MDX or somewhere to get this to work, but I can’t find anything that would let me do what I want.

Technorati tags: , , , , , , , , , , , , , , ,
Categories
Life Product Reviews

New (Old) good show – Heroes

Since I don’t have cable, I really don’t watch much TV. But every now and then you need some entertainment, and when the Netflix Queue is in the mail, I usually find something online. When I first got to Portland, I crashed at Emily’s for a week, and when I wasn’t Photowalking (hah!!) or out, I was on my laptop. I found that NBC has Heroes online, the whole season, full episodes, so I started watching it. When it first came out, I watched the pilot, but then I didn’t catch any other episodes, so I was kind of out it. I always saw the “Save the cheerleader, save the world” commercials online or on TV, and I kinda knew what they meant, but not really..

Now I do 🙂

Heroes is a great show. It is one of those shows that reminds me of the movie Crash. Where everything is interrelated. ABC had a show called Six Degrees what was the same way. And Heroes has super heroes, of course! 🙂

Technorati tags: , , , , , , , , , , ,
Categories
Geeky/Programming SQLServerPedia Syndication

SQL Server: SELECT Machine, Computer, Instance Names

to get the instance name: SELECT @@ServerName

to get the machine name of the server: SELECT SERVERPROPERTY(“MachineName”)

to get the machine name of the computer running the query: SELECT host_name()

one tip: cast the serverproperty as a varchar if you want to use it in a string or you will get errors in your stored procs/queries.

Technorati tags: , , , , , ,
Categories
Life

Unexpected new hobby: Photowalking

I think I found a new hobby: Photowalking.

From wikipedia: Photowalking is the act of walking with a camera for the main purpose of taking pictures of things you may find interesting.

I like walking around and just playing with my camera, taking pics here and there of things I think are cool, and hope some turn out. I read this all the time on Scoble’s blog about Photowalking and I’m like, yeah, that is what I do! Fun!

Technorati tags: , , ,
Categories
Geeky/Programming Life Product Reviews

Online Radio (Pandora) does make you buy music: The Generators

When I am not listening to my music collection, I usually listen to Pandora, using Open Pandora. Now, I know, no ad’s, how does Pandora make money? Well, I would gladly pay 30 bucks a year for this service, the Open Pandora app should be eaten up by Pandora.

Anyway’s, I kept hearing this song by “The Generators” – Roll Out The Red Carpet. And the lead singer sounds so much like Alkaline Trio, that I was like, yeah, this is good, so I went and bought it online, at Audio Lunchbox – 10 bucks, no DRM, mp3 format.

So, the theory that online radio doesn’t server its purpose is bunk, and that no DRM music is going to cause piracy is bunk, its just all bunk. It is just music. If people want it, they will get it. And I would rather buy it for cheap with no DRM than with DRM any day.

And with tomorrow being Online Radio Day of Silence, this is a fitting post, I suppose 🙂

Technorati tags: , , , , , , , ,
Categories
Life

Yes Mom, your son can cook…

Cooking. A chore if you will. Usually takes too much time, comes out wrong, and makes a mess of the kitchen. I usually don’t cook and if I do it is something simple. Last week Emily made us Lasagna (which was very good), so I thought I’d return the favor and make Salmon.

I’ve never cooked it before, so it was something new. Also, I have zero spices (why have them? for pizza?) so I ran to the store to pick them all up. After all that, I started on it. Mixing the spices and such, and then cooking it. It turned out OK I guess, I really don’t eat salmon that much, but we ate it and it didn’t kill us, so that’s a good first sign.

In a way, cooking is like programming. Take the requirements (the recipe) and then take some constructs (ingredients), put them together in a logical way, following some set of standards, and then test the output (eat! :))

Spiced Maple Glazed Salmon

Serves 2

1 teaspoon paprika
1 teaspoon chili powder
1/4 teaspoon ground cumin
1/4 teaspoon garlic powder
1/2 teaspoon brown sugar
1/2 teaspoon sea salt
2 (6 ounce) salmon fillets
1/2 tablespoon maple syrup
1/2 tablespoon melted butter
1/2 tablespoon chopped green onions

Step 0 – Crack open a Coors Light – use throughout all steps

Step 1 – Make sure the salmon is defrosted – so if you buy frozen fillets, let them sit out for a day, or buy fresh fillets

Step 2 – Preheat oven to 375 degrees

Step 3 – Create the spice mix. Paprika, chili powder, cumin, garlic powder and brown sugar

Step 4 – Put salmon on a baking dish

Step 5 – Sprinkle salmon with sea salt, then rub with spice mixture from step 3

Step 6 – Combine melted butter and maple syrup, and drizzle on the fillets, and sprinkle green onions on top

Step 7 – Bake for 10-12 minutes (15 at most)

Step 8 – Server with Salad, vegetable, rice, or something similar.

Step 9 – Open Wine, enjoy 🙂

P1000353 - Copy

If anyone is ambitious, try out the recipe and let me know how it tastes. Now if Microsoft would only make Namespaces in .NET called System.IO.Eating and System. Cooking I’d be set 🙂

Technorati tags: , , ,
Categories
Random

Is Oregon Really "The Empire of Tamriel" (The Elder Scrolls – Oblivion)??

Walking through the park today I snapped a picture

 

Washington Park 031

Now, take a look at this screenshot from Oblivion (the video game)

the-elder-scrolls-iv-oblivion-20060308025159759

 

Obviously the lighting is different, but yeah, I think Oregon might be part of the video game 🙂

Technorati tags: , , , , ,
Categories
Life

Washington Park, Portland OR

Took a walk through Washington Park today and took some snaps.

Washington Park 020

http://flickr.com/photos/scaleovenstove/sets/72157600454435349/

 There is the International Rose Test Garden, and the Japanese Rose Garden (I didn’t go into it, 8 bucks??). Nice day for a walk, a lot of people out there though…

Technorati tags: , , , , , ,
Categories
Geeky/Programming

Microsoft Popfly: Is This The Future of Application Development?

popfly_app

This is a screenshot of a mashup I created today using Microsoft Popfly. Is this the future of application development? Well, short answer, maybe.

It has a long way to go, that is for sure. First off, only services that have “blocks” available are able to be used. There are many services that don’t have blocks, or if they do, they don’t expose their whole API, just a subset. I would like to make a mashup to take my Flickr pictures and put them into Facebook. Yet the Facebook block only has “get” commands.

The application above, I took 3 sources of videos, and filtered their results to “Video Games”, combined the outputs, and then fed it into a video player. Took about 5 minutes. There are probably tons of uses for things like this, but as far as a full fledged application, I don’t think so. One big reason is you are too dependant on other services. There is also the 3rd party blocks that people have created, but you don’t really know what they are doing, once again dependant.

I really like the graphical part of it, it seems cool, makes it easy to get your API keys and such, but I think I would rather stick to coding this myself and knowing what is going on then doing it all graphically.

Here is the final video player

popfly_app_1

I think that if more and more sites expose API’s, and not just crap API’s, but good API’s then we might see this take off, since it is really easy to make a mashup. For now, it is a good Saturday afternoon goof around 🙂

Technorati tags: , , , , , , , , , , ,
Categories
Life

New Video on YouTube – 311 Cover – I'll Be Here Awhile

Since everyone thinks I won’t be in Portland long, I figured I would respond the way they would on the Simpson’s, in song.

Technorati tags: , , , , , ,