2nd Quarter Review

Half a year down already? This year is flying by a such a rapid rate and it seems hard to keep up at times. However, things are progressing and I’ve managed to stay on top of a few of my goals for this year.

To recap what those goals were:

  1. Blog more
  2. Learn more
  3. Attend more SQL Server Events
  4. Interact more with the SQL Server Community
  5. Sleep Less

So how did I do?

Blog more

I failed miserably at this one (Only 5 posts in for the 2nd quarter), but am ok with this as I had a lot of other, higher priority, items to keep me busy. I have been beavering away at Goal #2 “Learn more”, as well as doing a lot of Goal #5 by being there for my family – they are the most important part of my life after all.

Learn more

A great big 10/10 here! Just as a new version of SQL Server is about to be released, I finally got round to doing my MCITP – Business Intelligence 2008, and I learnt a lot more than I thought I would in the process. I failed the 70-448 first time round, which I was none too pleased about I can assure you. But I persisted and at the 2nd attempt I had it in the bag (if only just). I aced 70-452 at the first attempt and actually laughed out loud when I saw the result (916/1000). Couldn’t quite believe it. The whole exercise has been hugely beneficial. I have been able to apply what I’ve learnt to the projects at hand and have even corrected a few misconceptions that a colleague had (but I won’t be naming names…). Happy days!

I’ve also been involved in a number of projects that are focused on SQL Server Analysis Services. This is a massive win for me as this is one area of the Microsoft Business Intelligence stack that I was yet to really get to grips with. It has been a steep learning curve, but it seems that that is what I thrive on. It has also been loads of fun and the opportunity to work with and learn from different colleagues has been amazing.

Other things that have been picked up and refined along the way this year are data modelling, solution architecture & design, creation of development standards and generally improving my SQL Server related skills (T-SQL, SSRS, SSIS, SSAS) thanks to all you SQL Server bloggers out there.

Attend more SQL Server Events

It turns out that most of the SQL Server events are just not at the right time for me right now. My family duties take precedence and until the bedtime routine (5:30pm – 7:15pm) becomes easier, evening events are just not possible. However, Jim McLeod and I have managed to create and host a very successful SQL Server Social event in May. While it has been quiet since then, we are planning on follow up events in the very near future.

The PASS Summit 2011 is the big one for me this year. I am giddy with excitement at having the opportunity to attend. I’ll be spending more of my time preparing for it and making sure that I am able to make the most out of any and all opportunities that present themselves. My flights are booked, my registration is booked. It’s time to make a packing list!

Interact more with the SQL Server Community

Words with Friends anyone? I have been playing WWF with Rob Farley (blog | twitter ) ever since he mentioned the game in a comment on this blog post. More recently I have been playing the game with a few others in the SQL Server community, and even though there is not a lot of banter, there is a sense of familiarity. Which I am hoping will help when I get to the PASS Summit later this year. If you are keen for a game look me up –>“lukehayler”.

Yes, I know this is not the same as being active on forums, blogs, twitter, Facebook, and now Google+. But with the tiny amount of time that I do have to myself, this is all I can manage right now. I know that this will change over the next few months, and am taking steps to do so.

Sleep less

10/10. Easy when you have a 5 month old & an almost 3yr old in the house :)

Sorting on Multiple Columns in SSRS

There have been several cases lately where people have asked the question “Can I sort on multiple columns in my Table/Matrix report?” More often than not the answer given is an emphatic “No”. The fact is that you CAN sort on multiple columns by simply incorporating use of  the Shift key.

Assuming you have already set up interactive sorting on the columns you want to be able to sort by; run/preview your report. As you are already aware, the columns which can be sorted on have a two tiny arrows right-aligned in the column header. To sort on any one column just click on the arrows. Click on the arrow again to sort in the other direction.

MultipleColumnSorting

To sort on multiple columns, hold down the Shift key whilst clicking the arrows icons of the columns that you want to sort on. Start with the column you want to sort on first and then move to the next sort order, etc, etc. Click on any column arrow icon twice to change the direction (continue to hold down the Shift key until you have sorted on all the columns you wish to sort by).

Dataset sorted by Year (asc), Quarter (asc), Total (desc)MultipleColumnSorting_2

And there you have it. Multiple Column sorting in SSRS!

T-SQL Tuesday #017 – APPLY

imageWow the months go past quickly these days. It is already time for yet another T-SQL Tuesday, and this round is hosted by Matt Velic (Blog | @mattvelic). His chosen topic for this month is APPLY. If you are not sure what T-SQL Tuesday is about then please read this article written by Adam Machanic (Twitter | Blog).

APPLY

I could go on to tell you that APPLY comes in two flavours; CROSS APPLY and OUTER APPLY and that their use is primarily with Table Valued Functions or derived tables. I could even give you a couple of uses of APPLY and show you some examples. But that’s boring….and it’s covered by BOL and a host of much better bloggers than myself. Page 1 search results on Google reveal:

 

There are some other uses of APPLY too, namely:

APPLY Common Sense

Sometimes it is way better to APPLY some common sense to everyday hurdles. Don’t try to re-invent the wheel, chances are that someone has gone through what you are experiencing and has already come up with a number of solutions. If you have a problem, by all means attempt to conquer it yourself first, but don’t dwell on it too long. It doesn’t do anyone any good. The business will loose out on your productivity, and you may start to think that “it’s just to hard” – which leads to stress. Reach out!! The SQL Server Community is vast and is here to help. There are so many avenues which you can explore to obtain the help you need, here are just a few:

 

APPLY Yourself

Be honest with yourself. Has there been something that you have been putting off for while? I don’t care what excuse comes to the forefront of your mind. Make a point NOW to tackle it. Schedule it in your diary and Get It Done!!

In my last post, 1st Quarter Review 2011, I mentioned that I’d been putting off doing the MCITP – Business Intelligence 2008 Exams. Well, not anymore. I have now scheduled them and will be taking a crack at the first one on Friday, May 13th 2011. Yes, that’s right, I’m choosing to take my exams on Friday the 13th. I’m weird like that. I’ve made my commitment, now it’s time to make yours.

Thanks again to Matt for hosting this month’s T-SQL Tuesday. I’m certainly looking forward to seeing what others have come up with and reading Matt’s digest.

T-SQL Tuesday #016 – Aggregations

It’s T-SQL Tuesday time again! If you are not sure what T-SQL Tuesday is about then go and read this article written by Adam Machanic (Twitter | Blog). This month’s T-SQL Tuesday is brought to us by Jess Borland (Blog | @grrl_geek) and the topic is “Aggregation”. So let’s get started.

Matrix objects in SQL Server Reporting Services lend themselves to aggregation. With row and column groups prevalent in so many report requirements, it is inevitable that there will be subtotals at many different levels. Understanding Scope will enable you to refine your matrix object by applying different aggregate functions (or formatting options) to specific cells, or set of cells.

This is a post that I have been meaning to write for quite some time. In fact, ever since I did my original post on The InScope() Function and the key to formatting Matrix objects, I’ve been threatening to do it. This stems from all the comments and questions (via email) that I get relating to that post. Most of which are due to a lack of understanding of “scope”. So, while this may seem a trivial subject to a few of you, there are a lot of folks who just aren’t quite there yet. Also, this post is aimed at Reporting Services 2005 – I know that we are well into 2008 R2 by now, but I am aware that there are still many many companies out there who have yet to make that leap. Thankfully Reporting Services 2008 R2 deals with matrix subtotals in a much more user-friendly way.

 

Scope can be defined as (care of the Free Dictionary):

The area covered by a given activity or subject

For example: Applying this to a Matrix object, we can say that all the cells covered by a particular Column (or Column Group) header are in-scope of that particular Column (or Column Group) header.

I’ll use the matrix layout below as a template to attempt to explain this in a little more detail. This matrix has the following details:

  • A row detail [group] named “Countries”
  • A row group named “Regions”
  • A subtotal on the row details (“Region [1/2] Subtotal”)
  • A [Sub]total on the row group (“Grand Total (Region)”)
  • A column detail [group] named “Quarters”
  • A column group named “Years”
  • A subtotal on column details (2009/2010 Subtotal)
  • A [Sub]total on the column group (“Grand Total (Years)”)

image

Fig 1. Matrix object

For each of the figures below I have included a description of the scope that is being highlighted as well as an expression that can be used to generate the background colour for the cells that fall in-scope of the named group.

 

Fig 2. below shows the scope of the Row Details Group (“Countries”). All cells that fall within these rows (including the subtotals & grand totals) are within the scope of the Row Details Group.

image

Fig 2. Matrix object – Row Details (“Countries”) Scope

=IIF(InScope(“Countries”), “Green”, “White”)

 

Fig 3. below shows the scope of the Column Details Group (“Quarters”). All cells that fall within these columns (including the subtotals & grand totals) are within the scope of the Column Details Group.

image

Fig 3. Matrix object – Column Details (“Quarters”) Scope

=IIF(InScope(“Quarters”), “Green”, “White”)

 

Fig 4. below shows all cells that fall within the scope of both the Row & Column Detail Groups only.

image

Fig 4. Matrix object – Cells “in-scope” of both Row Details (“Countries”) & Column Details (“Quarters”)

=IIF(InScope(“Countries”), IIF(InScope(“Quarters”), “Green”, “White”), “White”)

 

Fig 5. below shows the scope of the Row Group (“Regions”). All cells falling within these rows are within the scope of the Row Group (“Regions”). Notice how this includes  the Region 1/2 Subtotals – these fall outside of the scope of the Row Detail Group (“Countries”), see fig 2.

image

Fig 5. Matrix object – Row Group (“Regions”) Scope

=IIF(InScope(“Regions”), “Green”, “White”)

 

Fig 6. below shows the scope of the Column Group (“Years”). All cells falling within these columns are within the scope of the Column Group
(“Years”). Notice how this includes  the 2009/2010 Subtotals – these fall outside of the scope of the Column Detail Group (“Quarters”), see fig 3.

image

Fig 6. Matrix object – Column Group (“Years”) Scope

=IIF(InScope(“Years”), “Green”, “White”)

 

Fig 7. below shows all the cells that fall outside of the scope of the Row Detail Group (“Countries”), but within the scope of the Row Group (“Regions”)

image

Fig 7. Matrix object – Cells “out-of-scope” of Row Details (“Countries”), but “in-scope” of Row Group (“Regions”)

=IIF(InScope(“Regions”), IIF(InScope(“Countries”), “White”, “Green”), “White”)

 

Fig 8. below shows all the cells that fall outside of the scope of the Column Details Group (“Quarters”), but within the scope of the Column Group (“Years”)

image

Fig 8. Matrix object – Cells “out-of-scope” of Column Details (“Quarters”), but “in-scope” of Column Group (“Years”)

=IIF(InScope(“Years”), IIF(InScope(“Quarters”), “White”, “Green”), “White”)

 

Fig 9. below shows all cells that fall outside of the scope of both the Row Details Group (“Countries”) and the Row Group (“Regions”)

image

Fig 9. Matrix object – Cells “out-of-scope” of Row Details (“Countries”) AND “out-of-scope” of Row Group (“Regions”)

=IIF(InScope(“Regions”), “White”, “Green”)

 

Fig 10. below shows all cells that fall outside of the scope of both the Column Details Group (“Quarters”) and the Column Group (“Years”)

image

Fig 10. Matrix object – Cells “out-of-scope” of Column Details (“Quarters”) AND “out-of-scope” of Column Group (“Years”)

=IIF(InScope(“Years”), “White”, “Green”)

 

Fig 11. below shows all the cells that fall outside of the scope of both the Row Details Group (“Countries”) and the Column Details Group (“Quarters”), but inside the scope of both the Row Group (“Regions”) and the Column Group (“Years”).

image

Fig 11. Matrix object – Cells “out-of-scope” of Row Details (“Countries”) AND Column Details(“Quarters”), but “in-scope” of Row Group (“Regions”) AND Column Group (“Years”)

=IIF(InScope(“Regions”), IIF(InScope(“Countries”), “White”, IIF(InScope(“Years”), IIF(InScope(“Quarters”), “White”, “Green”)), “White”)

 

Fig 12. below shows all the cells that fall outside of the scope of the Row Details Group (“Countries”) and the Column Details Group (“Quarters”) and the Column Group (“Years”), but inside of the scope of the Row Group (“Regions”).

image

Fig 12. Matrix object – Cells “in-scope” of Row Group (“Regions”), but “out-of-scope” of Row Details (“Countries”) AND Column Details (“Quarters”) AND Column Group (“Years’”)

=IIF(InScope(“Regions”), IIF(InScope(“Countries”), “White”, IIF(InScope(“Years”), “White”, “Green”)), “White”)

 

Fig 13. below shows all the cells that fall outside of the scope of the Row Details Group (“Countries”) and the Row Group (“Regions”) and the Column Details Group (“Quarters”), but inside of the scope of the Column Group (“Years”).

image

Fig 13. Matrix object – Cells “in-scope” of Column Group (“Years”), but “out-of-scope” of Column Details (“Quarters”) AND Row Details (“Countries”) AND Row Group (“Regions”)

=IIF(InScope(“Years”), IIF(InScope(“Quarters”), “White”, IIF(InScope(“Regions”), “White”, “Green”)), “White”)

 

Fig 14. below shows the cell (there can be only one) that falls outside of the scope of any named group in the matrix object

ef="http://lukehayler.com/wp-content/uploads/2011/03/image13.png">image

Fig 14. Matrix object – Cells “out-of-scope” of all named Row/Column Groups

=IIF(InScope(“Regions”), “White”, IIF(InScope(“Years”), “White”, “Green”))

 

Using the knowledge & understanding of the above combinations with SSRS expressions (to define values/formats) will enable you to refine your matrix-based reports and give the end user the required information.

Not sure how to get subtotals in your matrix objects? See my post on Creating Subtotals in SSRS 2005

TSQL Tuesday #014 – Resolutions

It’s that time again. Time for another TSQL Tuesday and this round, brought to you by Jen McCowan (Blog | @MidnightDBA), is all about Resolutions. Since I’ve not mentioned T-SQL Tuesdays on this blog before here’s a quick rundown of what it’s all about, as described by its creator Adam Machanic (Blog | @AdamMachanic:

T-SQL Tuesday is the SQL Server blogosphere’s first recurring, revolving blog party. The idea is simple: Each month a blog will host the party, and about a week before the second Tuesday of the month a theme will be posted. Any blogger that wishes to participate is invited to write a post on the chosen topic. The event is called "T-SQL Tuesday", but any post that is related to both SQL Server and the theme is fair game. So feel free to post about SSIS, SSRS, Java integration, or whatever other technologies you’re working with in conjunction with SQL Server. Even if your post includes no T-SQL we still want to see it. 

Read more about T-SQL Tuesday…

image

This T-SQL Tuesday (and its particular topic) couldn’t have come at a better time. I have only just posted about activity on the blog. In it I mention that my next post will list my goals for 2011. So I guess I get a 2-for-1 with this post!

So what am I resolving to do, or do better (or not do) in 2011? Well, my theme for this year is ‘more’ (it’s also my 2 year old son’s favourite word. Well, that and a very emphatic NO!):

Blog ‘more’

In early 2010 I set myself the goal of blogging at least once a week. I started fairly well and even got to scheduling posts as opposed to just hitting ‘publish’ once I was happy with what I had written. But life happened. I got to working crazy hours for about 6 months and then moved our family from London, UK to Melbourne, Australia. This effectively put a damper on writing for me and I finished the year with a measly 21 posts for 2010.

While the above resolution does not have an actual figure committed to it, I definitely need to do better than 21! And I am already making progress. I have posts scheduled through to mid-March, so I have a better feeling about this one already.

Learn ‘more’

Since the middle of last year I have been meaning to take the MCITP exams (70-452 & 70-448). But since I failed to plan for them then, they are now a 2011 challenge. I’m resolving to get these ‘done and dusted’ in Q1, and I already have drawn up a schedule to get this done.

I also am resolving to learn more about the ‘soft skills’ so often overlooked by technical professionals, but so important to the successful outcome of a project. Communication (with clients, staff members & the SQL Community), personal effectiveness, strategic thinking, team building and problem solving are some of the areas I’ll be looking at building and fine tuning during the course of the year.

Project Management – a new area for me, but one that I am starting to get very interested in. I’ve seen first hand how NOT having the necessary PM skills can lead to a project being pulled. So I’m taking steps to ensure that it doesn’t happen to any project that I lead.

Attend ‘more’ SQL Server Events

2010 was a busy year. So my attendance at various events was sporadic to say the least. I did get to SQLBits V in 2009 (Post 1, Post 2, Recap 1, Recap 2), but missed out on attending either of the events in 2010. These are such great events and if you get the chance to go you shouldn’t hesitate – I believe that the next one is to be held in Brighton, on the South Coast of England.

imageSo this year I have diarised the Local User Group events and aim to attend each of them. On the conference side of things, I may have cheated a little, as just before the end of last year I confirmed my booking for the PASS Summit 2011!! I am properly stoked about this and will be doing as much as possible to ensure that my first Summit experience is a great one. Which leads me to my next resolution…


Interact ‘more’ with the SQL Community

Twitter, blogging, comments, forums, user groups, conferences, email, Skype, and of course, meeting more people. Since my days are pretty busy during ‘working hours’, I’m going to try setting aside some time before the day really begins to get back in touch with the SQL Server Pulse.

 

Sleep ‘less’

Something has to give. Always.

In order to achieve what I have set out here I need to give up on something that I hold dear. Precious sleep. I used to think know that I needed at least 9 hours sleep a night. Then I became a dad. Now I know that I will get by on 7 hours.  And when a new bundle of joy (in the form of a daughter) joins us in about 6 weeks, I’ll ‘know’ I can get by on less than 5.

 

I’m looking forward to a great year. A year of family expansion, personal growth and community involvement. What do you have lined up?