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.

1st Quarter Review – 2011

Whilst I am not really the one to make resolutions, earlier this year T-SQL Tuesday #14 was about exactly that. Resolutions. So I jumped on the wagon and listed a few goals that I’d like to achieve this year. This is an update on those goals. I had a theme to my resolutions too, that theme is ‘More’.

1. Blog ‘more’

So far, so good with this one. I already have 12 posts for this year on this blog. I know that they are not all technical, but writing more (on any subject) gives me the practice I need to become a better writer (I use the term ‘writer’ very loosely…).

I have also started two other blogs. One is a personal blog and is primarily to keep all my family in the loop about our adventures. The other is all about Melbourne, Australia. The Melbourne blog is still undergoing some design decisions & tweaks as well as trying to get more and more content together before going live with it. The ‘go live’ for the Melbourne blog is set for the end of Q2. So that will be part of my next Quarterly review.

2. Learn ‘more’

Ok, so this is one that I have not faired as well as I had hoped. The MCITP – Business Intelligence 2008 has still not been realised. I grossly underestimated how much time and energy a new baby takes. In February this year my lovely wife gave birth to a beautiful baby girl, our 2nd child. I had set a goal to get the MCTIP by the end of the 1st Quarter this year, but I think I shall have to revise that to the end of the 2nd Quarter. To be brutally honest (with myself), I think I am afraid of failing, which is preventing me from even ‘having a go’. It’s definitely time to face facts and schedule a test!!

Other areas I wanted to improve on were the softer skills that are required for consulting. Whilst I feel that it is fairly difficult to measure these skills outright, I am definitely making progress in many areas. These are a couple of them:

  • I am now heading up my own team, so I have a bit of of ‘people management’ learning curve to undergo.
  • I am involved in the strategic planning of our team – this is a really fun aspect that I am looking to spending more time on.
  • Building up a rapport with clients and keeping the relationship in good stead. This is all about communication, communication, communication…

3. Attend ‘more’ SQL Server Events

Absolutely zero for this one. Time to refresh the local user group schedule and set aside some time to attend. Perhaps I might even set up a Melbourne SQL Server social once a month. Watch this space….

4. Interact ‘more’ with the SQL Server Community

Another mediocre performance here. Whilst I have had some good conversations over the last few months, I have not nearly been as active in this area as I had hoped. So If you do want to talk to me here are a few contact points:

5. Sleep ‘less’

Well this one was EASY! Needless to say I have outdone myself here. Since the birth of my daughter I have been getting, on average, about 4 hours a night during the week (I do the midnight feed anywhere between 11pm and 3am). I’m also glad to say I am slowly getting used to it. I am someone who usually requires a good 8 hours in order to function during the day, but I have found that I am managing on a lot less – but only if I keep going, if I stop for a few minutes I’m toast.

All-in-all progress is not bad, but could definitely be better. See you next quarter!