ImGoingToSqlBits150

My Twitter

twitstamp.com

Creating Subtotals in a Matrix in SSRS (2005/2008)

This is a quick look at how to create and use subtotals in your Matrix objects.

Subtotals 101

SQL Server Reporting Services makes it relatively easy to add totals to your columns and rows in a matrix object. In short, it’s as easy as right-click>Subtotal. Seriously, that’s it. Well, unless you want to format them, but that’s another issue entirely (an not quite as straight forward).

Let’s do this step-by-step :

  1. Open or create a new SSRS project
  2. Add a report item to your project.
  3. Add a dataset
  4. Add a matrix object
  5. Configure matrix to desired specification
  6. Add totals to outer groups by right-clicking the outer column/row group for which you require the subtotals and select subtotal.
  7. Add subtotals for inner groups by right-clicking the inner column/row group for which you require the subtotals and select subtotal.
  8. Tidy up by hiding the inner group line items initially – by right-clicking the inner group and selecting Properties>Visibility and then setting the properties accordingly.

Here’s a quick 2 minute screen cast of how to create subtotals in a Matrix object in SSRS 2005. It illustrates creating row group Totals & subtotals, but applies to column groups as well:

Here’s a link to another version if you are having any trouble: http://www.screencast.com/t/OGE1MmI4

My Current Favourite iPhone (3G) Apps

This is a list of my current favourite iPhone Apps. Most of these are free and where they aren’t, they’re almost free. I use each of these regularly and can highly recommend them. Just thought I’d share the love…. 

iPhoneApps_TweetDeck

Tweetdeck 

Cost: free

Category: Social Networking

Multiple accounts, multiple columns to segregate your groups & searches, synchronization with your desktop version, Facebook integration (if you like that sort of thing), choice of picture services (twitpic, yfrog, tweetphoto), geo tagging, In-app browser. I could go on. It’s my app of choice for Twitter. Follow @iandodsworth if you want updates from ‘the horses mouth’.  iPhoneApps_QikVideo

Qik 

Cost: £1.29

Category: Utilities

Video recording on iPhone 3G anyone? No limits on length of recording, wifi sharing, 200×152 or 400×304 resolution (higher resolution means slower frame rate though), on-screen settings for zoom | brightness | resolution | audio boost | special effects (normal, Black & white, Red only, ‘Avatar’). Size of files only limited by size of your device.

I had tried iVideoRecorder for a while but the 1 minute recording limit kept catching me out, especially when it then takes another minute to save the video you’ve just recorded. I will say this however, iVideoRecorder’s video quality is better. Both apps are the same price. iPhoneApps_SmartRecorder

Smart Record 

Cost: £0.59

Category: Utilities

Way better than the Voice Recorder that comes standard with iPhone (3G). Records for as long as you want (caveat – the most I have attempted was about 2.5 hours). App is quick to get started, is simple to use and quality of recordings is good, if not great. Syncs with Box.net, SyncDocs & over wifi, sharing via email, takes pictures during a session (remembers place in conversation when the picture was taken), appending to previous recordings. It also has a great help section if you do get stuck, which is rare.

iPhoneApps_UltimateToDos

Todo

Cost: £

Category: Productivity

Getting Things Done anyone? If you’ve read the book you’ll know what you need. This is the ‘electronic device’ that you’ll be wanting to play with all the time. It syncs to Toodledo, an web-based version of the app. This is the single most used app on my phone. The one thing I feel it is lacking though, is geo tagging of your to-dos (which is a feature of Remember-The-Milk). So if a future update of the app gets this feature it’ll be complete.

iPhoneApps_AmazonMobile

Amazon UK

Cost: free

Category: Online shopping

It’s amazon.co.uk in the palm of your hand, need I really say more? My only gripe with this one is that it took so long to come out (in the UK).  

iPhoneApps_NationalRail

National Rail  

Cost: £4.99

Category: Travel

Up-to-the-minute updates on your trains whereabouts, location aware, set a ‘home’ station, next-train-home router planner, journey planner, live departures & arrivals, platform information.

After debating over the purchase price for a while I finally cracked and bought it. I still think £5 is steep for what you can do via their website for free, however, they have managed to make their site so unusable (from an iPhone) that you don’t have a lot of choice. A while ago a chap named Malcom Barclay developed an app that showed all the train information (route planning, etc) and gave it away for FREE. Sure enough, National Rail decided this was too much of a good thing so took away his license to publish information and created their own application. Make what your will of it.

Is it a good app? Yes, for all the pain they put you through (on purpose in my opinion) on their website (via iPhone), they make up for in the usability of this app. If you travel on British rail I think that it’s something that you can’t do without (Well, you can, but this makes your life a LOT easier). For the price of two high-street coffees you get an app that is stable, user friendly, intuitive, and (in my case) the information provided has been spot on.

iPhoneApps_Ping!

Ping!

Cost: £0.59 (+ in-app purchase of £0.59 for picture messaging – worth it)

Category: Communication

You pay £0.59 for the app and you text for free. Add to that an in-app purchase for picture messaging and you are good to go. Any messages that you send or receive are free of charges – just make sure you have an internet connection. Only one other thing with this is to say that it only works between Ping! apps. So, in order to send a text/picture, your intended recipient will also need to have Ping! installed.

With the growth in application-based mobile devices nowadays it won’t be long until many more handsets/Mobile OSes are supported.

iPhoneApps_DropBox

Dropbox 

Cost: free

Category: Utilities

Sign up for a Dropbox account and sync all your files to the cloud and with any other computer you want. This is the app version, so now you can view all your files right on your iPhone. Sharing is by way of a link to the file in your Dropbox (which is placed in a email for you). In order for you to quickly view files you need right away you can select any number as favourites. These then are downloaded to your phone for when you don’t have a connection to the tubez. What would make this more of a killer app? Being able to attach the files directly to an email.

iPhoneApps_WhiteNoise

WhiteNoise 

Cost: Free

Category: Utilities

When I was growing up I always had a [desk] fan going (it was helluva hot where I used live and it kept away the mosquitoes), so I’m used to having some sort of drone whilst I am sleeping. White Noise does this wonderfully. It has loads of background sounds that help to immerse you in audible bliss. I find that the ‘Brown noise’ works brilliantly in drowning out all other sounds – and on the rare occasion that we have a party we use this to help our son sleep. It works wonders.

iPhoneApps_LetsGolf

Let’s Golf 

Cost: £1.59

Category: Games

Golf fan? This might make you one. A simple little game with great graphics and good challenges. Play a course at Fiji, USA, Scotland & England at varying levels. Earn a few prizes and get your name in lights along the way. A great way to pass the time waiting for trains….

iPhoneApps_NetNEwsWire

NetNewsWire 

Cost: free

Category: Utilities

Get all your RSS feeds into one place on your iPhone. Download the feeds whilst you have an internet connection and you’ll have something to read where ever you go. That is unless some blogs only give an excerpt in their feed, which narks me off royally. For those of you that don’t feed the whole post go read this post.

iPhoneApps_Units

Units 

Cost: free

Category: Utilities

All your conversions in one handy place. For free.

iPhoneApps_AbsoluteRadio

Absolute 

Cost: free

Category: Entertainment

Absolute radio. Absolutely awesome. Absolutely Free. Internet connection required.

iPhoneApps_AngryBirds

Angry Birds 

Cost: £0.59

Category: Games

Because it’s addictive. Apparently some Pigs stole eggs from the Birds and now the Birds are pissed. Your aim (‘scuse the pun) is to destroy the pigs by flinging different [angry] birds at various structures housing the bacon pigs. Loads of fun and fairly simple, what more could you ask for to waste away the time?

iPhoneApps_LondonTubeDelux

London Tube Deluxe 

Cost £0.59

Category: Utilities, Travel

This app is another must for those in London. Covering all of the underground lines, London Tube Deluxe has an up-to-date status for each line (including a description of the fault, if any), a map overview (PDF), journey planner, departure times and locates your nearest tube station.

 

That’s my list for now. I’m always on the lookout for more great apps so if you have any recommendations let’s hear about them!

Custom Visibility Toggling SSRS 2008

A while back I wrote a post about how to toggle the visibility of rows/columns in tables/matrices for SSRS 2005. In the comments of that article someone asked how this was done in SSRS 2008. The short answer was that the method is the same. However, setting all the properties can be confusing as their whereabouts is a little different. Hopefully this post will clear things up.

Let’s do this by way of example:

I created a project with a single report. The Data source is AdventureWorks2008 and we are looking at Total Sales figures by Year & Month (keep it simple right?). I have set up a matrix object and added the required fields and set subtotals for Month & Year. See Fig 1. below:

Objective: Enable Toggling of the Month group, using the Year Group as the Toggle Item

At this point I want to point out two key areas, as this is where we will be concentrating our efforts:

  1. The Row/Column Groups section at the bottom of the designer
  2. The Visibility Properties at the bottom right corner (Last item in the Properties list – but only when an object is selected)

Now, select the drop-down arrow for the Month Row group (See Fig 2.), choose Properties and then select the Visibility tab.

The objective is to enable toggling of the Month rows in the Matrix. We could choose to Show or Hide the Month rows when the report is initially run, or to make this decision based on an expression. Using an expression will determine which rows are expanded and which are collapsed when the report is run initially. I have chosen to use an expression:

=IIF(Fields!YEAR.value=2001, False, True)

This says that if the Year group value is ‘2001’ then show the Month Sales Total values (‘Expanded’), else Hide the Month Sales Total values (‘Collapsed’). See Fig 3. below:

Also note (in Fig 3. above) that I have set the YEAR cell as the Toggle Item. We’ll configure this next.

Once you have set the above properties go back to the designer and highlight the YEAR cell in order to view its properties. These should be on the bottom right, otherwise right-click the cell to bring up the properties window. Find the Visibility > InitialToggleState property and set it using the following Expression:

=IIF(Fields!YEAR.Value = 2001, True, False)

This says that if the Year group value is ‘2001’ then show the toggle icon as ‘Expanded’ (True), else show it as ‘Collapsed’ (False). This allows us to ensure that we are in sync with the expression we used to set the initial visibility of the Month rows. Fig 4. shows the end result of all this hard work:

The Visibility Properties

Understanding what each of the three visibility properties does will help to use them effectively.

Hidden – Can be set to either ‘True’ or ‘False’. This can be done by selecting True or False from the drop down, or by using an expression to set either of those values after evaluating a condition. True equates to the object being hidden and False to the object being shown (tricky eh?).

InitialToggleState – This is only applicable if the object that you have selected can toggle the visibility of other objects. It refers to the state of the toggle icon and can either be ‘Collapsed’ (‘+’) or ‘Expanded’ (‘-‘). As explained by way of example above, setting this to ‘’True’ sets the icon to the ‘Expanded’ state, and False to the ‘Collapsed’ state.

ToggleItem – Use this property to set the object that will enable the user to toggle the visibility of another item. In the example above, I have chosen YEAR as my toggle item for the Month Group.

Beware the Gremlins

You need to be aware of setting properties for the right objects or groups, or you may find that your report does not display correctly:

Fig 4. shows what happens when you set the Visibility properties for the Month & Data CELLS in the report instead of the Month Group properties. Setting the Month Group visibility properties means that you won’t get that nasty white space, and there’s no need to set the visibility of the cells (in this instance).

I have placed the example project in a nice little zip file for all you folks that might want such a thing.

SQLBits VI has been announced!

That’s right folks. Another SQLBits is almost upon us. And this time it’s in London! This SQLbits is to be held at the Church House Conference Center on the 16th April 2010. Details will be updated over at www.sqlbits.com. Simon is on lookout for volunteers, so if you are interested in helping out in anyway you can, contact him or leave a comment here (& i will forward the details to him).

See you there!


View Larger Map

SQLBits (V) Videos available for Download

That’s right folks. If you missed out on some (or indeed all) of the awesome presentations at SQLBits V, you can now view them online or download them for viewing at your leisure. Simon Sabin has done a great job once again, so a big thanks to him and the rest of the SQLBits team.

Here’s a taster for what is available:

And of course the link to the entire list is right there under each of the presentation descriptions.

If you need a recap of SQLBits V you can read all about it here (Part 1) and here (Part 2).

Download Reports (.RDL) files for editing (SSRS 2005)

If you ever happen to be in a situation were you do not have access to or have ‘misplaced’ the SSRS report files (.rdl) and you need to edit one (or more) of the reports on your server, there is an easy way to download the .rdl files.

Follow these easy steps:

  1. Open SQL Server Management Studio,
  2. Log on to the Reporting Services Instance that contains the reports you are looking for
  3. Browser through the directory structure to the report that needs to be updated
  4. Right-click the report and choose Edit…
  5. Now follow the prompts to save the file to a destination of your choice
  6. Open BIDS & create a new project/solution
  7. Import the (previously) saved .rdl file into your SSRS project.
  8. Edit away to your hearts content….

 

I’m not going to ask why you don’t have access to or have misplaced the files in the first place (No source code management? Seriously?). I am sure there are a myriad of reasons that you can come up with. This post merely provides a quick way to recover your files and continue edits/updates that may be required.

SQLBits V – Conference & Session Recap (Part II)

This is the second part in my recap of SQLBits V. You can read Part 1 here.

Sessions

I was assigned as a room monitor on the Saturday, and as 3 of the sessions I was planning on attending were in the BI track, this is where I ended up. The day for Room 1 went as follows:

Getting Dimensional with Data -  Chris Testa O’Neill (Blog | Slides)

Chris took us through the basics of building a cube, highlighting the use of data sources and data source views, the importance of dimensions and hierarchies, and of course the measures that will hold the business metrics. This was a good talk on getting started with building your first cubes.

A Whistle Stop Tour of SSIS Add-ins – Jamie Thomson (Blog | Twitter | Slides)

Jamie introduced us to a number of free/paid for SSIS add-ins. He described each add-in, how it was configured and demoed a practical use for each. I have already written about this session in Part 1 of the Conference Recap. Jamie put a lot of work into his demos, so a big thanks to him.

Self Service Business Intelligence (Project Gemini) – Bob Duffy (Blog | Slides)

Bob took us once again through building a business intelligence solution with Office 2010 and Gemini. It seems that no matter how many times I see presentations on this stuff I don’t get tired of it. Looking forward to the moment I can use these tools in a commercial setting. Whenever that might be….

SSIS in SQL Server 2008 – Allan Mitchell (SQLIS.com | SQLDTS.com| Slides)

Allan did a great job (even though he overran his session by ‘a few minutes’) of informing us of a couple of differences in Threading between SSIS in SQL Server 2005 & 2008, why you need to be using the Cache & the Lookup Transform, the Data Profiling Task and Change Data Capture. Another enjoyable and informative session.

Report Builder 3 – Andrew Fryer (Blog | Twitter | Slides)

Andrew wowed us all. Again. Even with some demo trouble (he was plagued with ‘technical issues’) it was a fabulous session. He took us through all the features of Report Builder 3 as a Managed Self-Service BI tool. Items to note:

  • The Tablix Object
  • Improved Visualizations (Better Charts & Gauges, Maps, Sparklines, Data Bars, Indicators)
  • Interesting layouts (see slides)
  • Support for Spatial Data
  • Integration with Virtual Earth tiles.
  • Multiple Map Layers
  • A number of Layout enhancements (new functions, new data sources, Expression-based page breaks & chart headers, Excel tab naming, Bottom-to-top text rotation)
  • Aggregating aggregates

This was the last presentation of the day and of the conference and it ended on an high note.

Everyone then piled out into the foyer for drinks & games. About an hour after the social started Simon gathered everyone for prize giving – There were several prizes and winners were chosen by selecting completed feedback forms from a box (that contained all of them). I couldn’t believe it (cue Victor Meldrew). On the fourth attempt a feedback form of mine was pulled out and my name was called. Score! I still wonder at how the Redgate SQLComapre license was still there for the taking. This is after 3 other winners had taken mice, & webcams from the pile. I think I did pretty well. Thanks Redgate!

Volunteering

As I have mentioned before, SQLBits is a not commercial conference. It is organised and run by a handful of professionals that do it in their own time. I offered to be one of the helpers at this November’s conference and was glad I did so, as I got to meet and interact with a number of great people. It can sometimes be difficult to start a conversation with someone you don’t know (as I mentioned here) unless you have something in common, or an icebreaker. Volunteering can be the icebreaker. It forces you to meet a bunch of new people and gets the ball rolling.

So what did volunteering at SQLBits involve? About an hour of my time on the Friday evening, and playing room monitor in one of the rooms (BI Track) for the day – which meant that I couldn’t attend all of the sessions that I was aiming to, but as most of them were in the same room this wasn’t too much of an issue for me. To be honest, it was a lot less work than I had expected – note to self: must get involved earlier next time.

And what did I gain out it? A better understanding for what is involved in organising a SQLBits conference, meeting and conversing with the organisers, speakers and other volunteers, making new contacts and friends, being part of the community, a wonderful dinner late on Saturday night, and a great bonus from the organisers which was totally unexpected. So a HUGE thanks to Simon, Chris, James, Darren, Martin & Allan. You have pulled off (another) great conference and I am sure that I am not alone in saying that I can’t wait for the next one.

The People I met

Meeting more sql folks was one of my goals for the conference and I think I did pretty well. What remains to be seen is if I managed to leave a good enough impression. Over the two days I was at SQLBits I had the privilege of meeting and chatting to a number of people, some for just a brief few minutes, others for good enough chunk of time to get to know them a little better. Here’s a few of those awesome folks:

A fantastic group of people, all knowledgeable in their own sphere of SQL Server, and great personalities. I found I had the best conversations later in the evening once things had quietened down a bit. I think it would be great if there were more opportunities for quiet times like these, as sometimes they are of the most benefit. I believe that some others actually forego sessions when they’re having a great conversation with a new (or indeed old) acquaintance.

It would be nice to see a little more time (and possibly structure) attributed to mealtimes during the conference. These are times that could be used to great benefit for that all important networking. I have a few ideas that I’d like to pass around and will possibly write another post about it later. At the very least I’ll pass them along to the organisers (or possibly something that I could organise???). For those that were lucky enough to go to the PASS Summit, what opportunities did you have for catching up with old friends & getting to know some new folks?

So, what did I learn at SQLBits?

I have mentioned previously the sessions that were my highlights and have gone into some details there. This is a list of other things

  • Arrive early – to the conference and to each session. You’ll get the lay-of-the-land and you get to meet a few people before it begins to get crazy. At the very least, get to your sessions on time. Speakers have a set time to give their presentations and need to have some time for questions. Your questions. If they have to start late due to interruptions, there’s less or no time for questions.
  • Leave late – Stay over on the last evening. I found this to be the best time for conversations with speakers, MVPS, organisers and attendees (that also stayed over). The stress of the sessions and the conference has abated and people are much easier to talk to and get to know.
  • A book/laptop/netbook/napkin/whatever – Bring something to take notes. Anything. Just ensure that you take notes for things that spark your interest. The sessions can be fairly intense (speakers try and pack in as much as they can) and your brain will be overflowing pretty quick (well, maybe I only speak for myself here), so taking notes enables you to revisit the key points at a later date when you have the time.
  • Business/Contact cards – get some made and hand them out. I met many more people than those on my list but due to my overflowing brain, just couldn’t keep track. Go get some cards people! If you weren’t on the receiving end of one of mine (care of moo.com), here’s an electronic copy:
  • Luke_Hayler_Contact_Cards Luke_Hayler_Contact_Cards
  • Ask questions – if you don’t you’re missing out on some valuable first-hand information from some of the brightest sql folks around. It also helps to prepare some ahead of time. The sessions and speakers are listed well ahead of time, so take a note of those sessions you would like to attend and write down the questions you may have.
  • Time to digest – set aside some time, even just an hour, during the day to digest what you’ve learned and who you may have met. You’ll be surprised how easily this information will escape you if you if don’t. So, got get your favourite beverage, find a quiet spot and go through your notes, you may find that you have a few questions, which you can now go pose to the speaker of the session, or indeed any others.
  • Attend a Donald Farmer presentation. ‘nuff said.
  • PowerPivot, Excel 2010, Reporting Services in 2008 R2 – are all pretty awesome. I can’t wait to get my hands on these and building some mind blowing data analysis and reporting solutions.

Some Suggestions & Ideas

  • Better information about sessions – I found that while most of the sessions were well described (in the schedule), there were some that held little or not information about the session, and one or two that had misleading titles. This makes it pretty difficult to know what to expect when you are attending. Given that feedback is so valuable to speakers (and organisers), I would have though that if someone’s expectations were not met then the speaker might receive poor feedback. Ambiguity about the session also leads to more disruptions – people will leave during the session if they feel that it’s not quite what they expected. Personally, I would like to know exactly what the session is about before I make a decision to attend. Most of the speakers I saw had an agenda slide. This is perfect for the session description.
  • Several screens in the foyer (TVs/projectors/etc) with any important announcements (room updates, next sessions, etc)
  • Live Twitter stream in each session room – which could be managed by a room monitor perhaps.
  • More time to mingle – I know that the sessions are the core of the conference, but wouldn’t having more time to get to know people and ask the MVPs/Speakers/other attendees questions help too? There was barely enough time between the sessions to get a cup of coffee & a biscuit (or cookie for our US readers) let alone meeting and having a meaningful conversation. I am not sure how much of a nightmare it would be to start sessions earlier and finish later in the day, but it might make the day easier to handle – from an attendee point of view.

Did you attend SQLBits? Do you have any comments on any of the above Suggestions & Ideas (or indeed anything else I’ve mentioned)? Let’s hear from you!

You’re still reading this??

This has been a fairly epic post, so if you have made it all the way down here I applaud you. Thanks for sticking it out!

This has been my experience. I hope it provides a good summary of what SQLBits is about and if you weren’t already thinking about going to the next one you should definitely make plans to do so. It’s worth it.

See you at SQLBits VI!

SQLBits V – Conference & Session Recap (Part 1)

Better late than never

I’ve been a little under the weather since getting back from SQLBits V so this post has been days in the making instead of just s a few hours. But here it is. This post focuses on the conference sessions, I am going to follow up with another post on people, conference feedback and things I might do differently next time.

Even the birds aren’t up this early…

Friday started swimmingly. Up at the crack o’ dawn,  taxi to a mainline station (my local didn’t have an early enough train to get me into London), only to find that the train has been delayed by 18 minutes. Pants. There goes all my hard work ‘being early’. The good news is that I made it on to the Newport Train (from Paddington). With just 2 minutes to spare. And I got a seat with a power outlet. Bonus! All my good intentions at getting a head start on an article have gone out the window as I am a little tired, so I try to catch up on some much needed shut eye.

Keynote by Donald Farmer

I arrived at the Celtic Manor, having shared a taxi, just in time for registration and a quick bacon bap before the welcome started. The keynote was given by Donald Farmer (Blog | Twitter). He gave us a great preview of the simply awesome PowerPivot and a few features in SQL Server 2008 R2. See this recap by Brent Ozar.

Below is a recap of the sessions that I found I got the most out of.

Friday Session 1 – New Development Features in SQL Server 2008 [Simon Sabin]

The first session of the day, that I attended, was Simon Sabin’s (Blog | Twitter) overview of the new development features that can be found in SQL Server 2008. Simon favours the demo approach for sessions and so had relatively few slides. Not a bad thing. Among other features available in SQL Server 2008, the following were discussed/demoed:

  • Variable declaration and initialisation – this can now be done in the same line (Declare @i Int = 1)
  • Named regions - You can create these using BEGIN & END blocks & naming it with a comment. Named regions will enable you to collapse the blocks for readability.
  • Intellisense – as has been available to .NET programmers for years. My only query here is, why not use the syntax that can be found in C# when writing LINQ queries [where you specify the FROM TABLENAME line first and then the SELECT statement). As such, you find yourself writing the FROM line first and then going back up to the SELECT statement….
  • Highlighted Syntax errors - think MS Word red squiggly lines to highlight that something is the matter.
  • Code validation at design time -
  • Date & Time datatypes - new Date datatype allows dates before 01/01/1753, and only takes up 4 bytes of storage. great for when you don’t actually need time precision. Time datatype handles precision down to the nano second, for when you do. The Time datatype also only refers to the time of day and not a time interval.
  • No longer allowed implicit calculations on dates - you now must use Date functions to perform calculations on Date datatypes (i.e. DateAdd(), Not “MyDatetime + 1”).
  • DateTime Offset - Allows you to store the date and time that has time zone awareness (based on the 24-hour clock)
  • Debugging - You can now debug your code! breakpoints, watch lists, view locals, etc
  • MERGE Statement - enables you to perform updates/deletes/inserts all within one statement.

Whilst this list is not conclusive, it certainly highlighted a number of new features that are now available in SQL Server 2008 and incentivises you to at least find out what else is available that could simplify you SQL development.

This was a great session, and if you find out that Simon is doing a presentation near you (UK User Groups), I suggest going.

Friday Session 2 - SQL Server 2008 R2: What’s new in Reporting Services? [Donald Farmer]

Donald Farmer (Twitter | Blog) blew my mind. Not once, but twice. First, in his keynote, he talked about the awesomeness of PowerPivot. Then in this session, he did it again. I loved this session and quickly realised that there’s going to be quite a learning curve and an altering of mindset of how reporting ‘gets done’ in the future. Why? Because the lines between the business & IT are blurring.

With the new Self Service Analysis and Reporting tools, there’s a new approach to finding out and tracking how the business is performing. So, if you are a Reporting Services Developer or Data/MI(S) Analyst. Things are going to change:

  • PowerPivot & Excel 2010 bring a lot more functionality ( & power) to business users. Enabling them to analyse data at length straight from the data source.
  • The arrival of report components in report builder, means that reports can be built quicker using existing parts of reports or report items. Think sub-reports, but on a more granular scale. Each report item can be a reusable component, which can be tweaked by the user for use in their own report.This includes the reuse of datasets, as components. These components are centrally managed by IT (or a reporting team).

So what did we learn? Here’s a bulleted summary:

  • Business users analyse data through tools like PowerPivot & Excel 2010, digging for answers to business questions. This analysis is an iterative process and gives rise to metrics that can be monitored. Enter reporting services. Reports are built to monitor the ‘answers’ discovered by the business analysts.
  • Reports can be created using components. Components are pre-built report objects that reside in a library that anyone can reuse. Think of sub-reports, but in a centrally managed way.
  • Created reports that are saved to the Server are saved as a report in its entirety, as well as individual report components. These components are then available to other users to include/tweak in their own reports.
  • When Publishing reports, you can choose which components of the reports you want to publish.
  • Report Data can be subscribed to via feeds (rss anyone?). This can be used to in PowerPivot to run Excel-based analyses using Pivot tables
  • New features of Reporting Services:
    • Spark lines – think inline charts. No x/y axes. Just used to illustrate a trend.
    • Data bars – no more having to use expressions to calculate cell padding and the applying a background colour. Pick your element & configure.
    • KPI’s – like those in SSAS, you can now add a KPI and configure it’s value, goal, status & trend. KPI’s can be ‘componentised’ and reused in other reports.
    • Lookup functions
    • Aggregates of Aggregates
    • New data sources (Project Madison, SQL Azure)
    • Ability to reset page numbers based on groups
    • Expression-based page breaks
    • Expression-based chart headers
    • Naming Excel Worksheet tabs (on render to excel)
    • Bottom-top text rotation
    • Session variables
  • R2 to be released in first half of 2010 (CTP is already out).
Saturday Session 2 – Jamie Thomson’s Whistle Stop Tour of SSIS Add-ins

In this session Jamie took us through the fact that there are a number of SSIS custom tasks available on the intertubez. Many of them are free and can be found on CodePlex. There were only one or two slides (Jamie’s contact info), as the whole session was taken up demoing each of the tasks he had chosen.

  • XMLify Task
  • Kimball SCD (Slowly Changing Dimensions) Task
  • TwitterTask
  • Term Extraction Task
  • Normaliser Task
  • Rank Transform Task
  • Compression & Decompression Task
  • FileWatcher Task
  • Trace File Task
  • Dynamic Data Flow Task
  • XMLify (http://xmlify.codeplex.com) – takes columns that you specify (from a query/view) and loads them into an xml block. Jamie demoed this for capturing error outputs.

    Kimball SCD (http://kimballscd.codeplex.com) – For slowly changing dimensions. Takes all data in the destination and for each column you can define it’s usage ( type 1 change, type 2 change, business key, surrogate key, etc). Type 1 changes will update the destination data based on the source data. This task is a monster. Loads of options for configurability.

    Twitter task (http://ssistwittersuite.codeplex.com/) I think this is awesome. You can automate sending your tweets. Careful though, password is in full view in design mode. You can also get all replies/mentions and then data mine them using the Term Extraction task. I can see this being used as a substitute for text (SMS) messaging notifications, for whatever you need to be notified about (if you’re always on Twitter).

    Term Extraction – A data mining task to pick out nouns, verbs, phrases. Although not an add-in (comes with SSIS) this is still a neat task that I had not used previously. Jamie is using it to sift through the Twitter feed to his @ssisdemo Twitter account. Very cool use to see what people are saying (words & phrases), and how often each occurs. Could be useful, I guess.

    Normaliser (http://normaliser.codeplex.com) – Normalises the data from an incoming data stream. Pure. Simple. Awesome. Data must be sorted as a prerequisite. This task only handles one to many relationships.

    Rank Transform (http://ranktransform.codeplex.com) – Ranks a dataset by Partition. Enables you to view a dataset ordered and ranked (by specified column), as well as being able to specify a partition for the ranking (i,e, month). The dataset must be sorted before use. Rank & Dense Rank have their differences, specifically where you have two ranked values that are equal (a ranking ‘tie’). So, if you have two values that are equal and ranked ‘2’, then for the column RANK the next value will be ranked as ‘4’ whereas the column DENSE RANK the next value will be ranked as ‘3’. Still confused? Go here.

    Zip task (http://cozyroc.com/ssis/zip-task)- this task takes a source file and compresses it into a gzip file (.gz). That’s it. Decompression decompresses the file. This will only work with a single file and not for a folder or multiple files. I think I would prefer to use 7zip and an Execute

    FileWatcher (http://www.sqlis.com/post/File-Watcher-Task.aspx) – This task ‘watches’ a directory, when a file is detected it will progress the flow to the next task. Placed in an endless loop this will continually execute, and will pick up files as they arrive. Neat.

    Trace File (http://www.sqlis.com/post/Trace-File-Source-Adapter.aspx) – understands a sql trace file and enables you to handle the trace file contents.

    Data Flow Plus (http://www.cozyroc.com/ssis/data-flow-task) – Enables you to populate two different tables with the same data flow. Neat.

    Trash Destination (http://www.sqlis.com/post/Trash-Destination-Adapter.aspx) – Enables you to send any data flow to a trash destination. No configuration required, so ideal for a number development scenarios.

    This session, along with those by Donald Farmer, was the most enjoyable and one that I probably took the most away from. It opened my eyes to the world of custom SSIS tasks and that fact that so many of them are freely available (with source code so that you can tweak at leisure). Jamie definitely seems to be the go-to guy for SSIS related  info. If you haven’t checked out his site yet, I suggest doing so: http://sqlblog.com/blogs/jamie_thomson/default.aspx

    Other SSIS Add-in Links:

    Go to Part II of the SQLBits recap.

    The DatePart() Function in SSRS

    Using the DatePart() Function in SSRS can be tricky, even at the best of times. I have pulled my hair out too often trying to remember what syntax should be used, so have resorted to writing down all my findings. This is so that you don’t have to go through the same agony & frustration as I did, as well as for my own benefit (my memory is shot…)

    What it does: Returns an Integer containing the specified part of a given date

    Syntax: DatePart(interval, date[,firstdayofweek[,firstweekofyear]])

    There are two ways to use this function:

    • Using the DateInterval collection
    • Using a string expression
     
    Using the DateInterval Collection

    Let’s start with an example:

    To return the current month: =DatePart(DateInterval.Month, Today())

    Now, in the expression builder (in BIDS), it will look like there’s something the matter with what we have just written:

    You can ignore this, the expression will work. An important point to note when using the DateInterval collection, is that you must use a date that is of type Datetime. If you use a string representation of a date (“2009/11/13”), then you’ll need to convert this to Datetime using CDate(“2009/11/13”) before the expression will work. Thus:

    This will work:  =DatePart(DateInterval.Month, CDate(“2009/11/13”))

    This won’t:  = DatePart(DateInterval.Month, “2009/11/13”)

    When you use the DatePart function to identify the day of the week you can specify what the First Day Of The Week is (defaults to Sunday if this is not specified). You can do this by accessing the FirstDayOfWeek collection. Example – To Return the day of the week, specifying Monday as the first day of the week:

    DatePart(DateInterval.Weekday, CDate(“2009/11/13”), FirstDayOfWeek.Monday) returns 5 (Friday)

    All the possibilities for using the DatePart() function with the DateInterval Collection:

    The following table shows all the possibilities for the DatePart Function using the DateInterval collection. All expressions use a Parameter called MyDate (type = Datetime), which has a value of “2009/11/13 12:34:23”

    Expression Result
    DatePart(DateInterval.Second, Parameters!MyDate.Value) 23
    DatePart(DateInterval.Minute, Parameters!MyDate.Value) 34
    DatePart(DateInterval.Hour, Parameters!MyDate.Value) 12
    DatePart(DateInterval.Weekday, Parameters!MyDate.Value, FirstDayOfWeek.Monday) 5
    DatePart(DateInterval.Day, Parameters!MyDate.Value) 13
    DatePart(DateInterval.DayOfYear, Parameters!MyDate.Value) 317
    DatePart(DateInterval.WeekOfYear, Parameters!MyDate.Value) 46
    DatePart(DateInterval.Month, Parameters!MyDate.Value) 11
    DatePart(DateInterval.Quarter, Parameters!MyDate.Value) 4
    DatePart(DateInterval.Year, Parameters!MyDate.Value) 2009

     

    Using a String Expression

    Again, let’s start with an example:

    To return the current month:  =DatePart(“m”, Today())

    Using a String expression for your interval enables you to use a date that is of datatype String:

    =DatePart(“m”, “2009/11/13”)

    All the possibilities for using the DatePart() function with a String Expression:

    As noted previously, using a string expression for the interval allows you to use a date value that is of the String datatype. You can of course use a Datetime value if you wish to.

    This table shows all the possibilities for the DatePart function using a String Expression for the interval. All expressions use a Parameter called MyDate (type = String), which has a value of “2009/11/13 12:34:23”

    Date Part Expression Result
    Second DatePart(“s”, Parameters!MyDate.Value) 23
    Minute DatePart(“n”, Parameters!MyDate.Value) 34
    Hours DatePart(“h”, Parameters!MyDate.Value) 12
    Day of Week DatePart(“w”, Parameters!MyDate.Value, FirstDayOfWeek.Monday) 5
    Day of Month DatePart(“d”, Parameters!MyDate.Value) 13
    Day of Year DatePart(“y”, Parameters!MyDate.Value) 317
    Week of Year DatePart(“ww”, Parameters!MyDate.Value) 46
    Month DatePart(“m”, Parameters!MyDate.Value) 11
    Quarter DatePart(“q”, Parameters!MyDate.Value) 4
    Year DatePart(“yyyy”, Parameters!MyDate.Value) 2009

     

    Is there a preferred method?

    Ultimately, no. At the end of the day, all the results are the same. What is my preference? I use the DateInterval collection, mainly becuase I like that fact that you can’t get confused about which date part you are using (w/ww, y/yyyy, n….). It’s very clear to anyone who is reading the code that (for example) DateInterval.WeekOfYear refers to the week of the year and nothing else. It also forces you to use a Datetime Value, which safeguards against invalid dates (sort of).

    I hope this clears things up a little!

    SQLBits Agenda is now available

    The SQLBits agenda is up! And not a moment too soon. I understand that the organisers had a few issues when initially trying to get the schedule on the site, but all is resolved. These guys do great work to provide an amazing service to the community, and all at their own expense. So every credit to them as well as a big thanks from the rest of us!

    You can find the SQLBits agenda here: http://sqlbits.com/information/newagenda.aspx

     
    Lending a hand

    After reading Jeremiah Peschka’s (@peschkaj) article, Volunteering with PASS, I’ve realised the need to help out if I can. So, one of my goals at the conference is to find a few of the current organisers and figure how I can get involved. Is there any better way to rub shoulders with the best & the brightest out there? So, if Simon or James or Chris or Martin or Darren or Allan happen to read this, then consider this my offer to help. By the way, you’re all on my list of people to meet… ;)

     

    My Schedule

    When I originally planned to go to SQLBits I wondered whether or not to go up on the Thursday evening or rush in on the Friday morning. I was never going to make the Thursday pre-con, so it was a toss up between shelling out more ££’s for another night in the hotel or risk missing the start of the Friday program. So I gambled and decided I would travel on the Friday morning. This was done before the agenda was published (train tickets are sooooo much cheaper if you book in advance, see my previous entry), hence the gamble. It seems to have paid off however, as registration is from 08:45 – 09:40 and I should arrive (hopefully) at around 09:30. Just in time.

    Here’s my planned schedule (if you’re remotely interested):

    Friday, 20th November:

    [07:15 - 09:05] Train from London Paddington to Newport, South Wales
    [09:30 - 09:40] Registration
    [09:40 - 11:00] ‘Welcome’ session
    [11:00 - 12:00] SQL 2008 Development Features [Simon Sabin]
    [12:20 - 13:20] What’s New in Reporting Services 2008 R2 [Donald Farmer]
    [13:20 - 13:40] Lunch & networking
    [14:40 - 15:40] Powershell – Old Tricks for a new dog? [Martin Bell]
    [16:00 - 17:00] Virtualising SQL Server [Justin Langford]
    [17:00 - 18:00] SQLBits Shenanigans…
    [18:00 - ??:??] Social

     

    Saturday, 21st November:

    [07:30 - 08:30] Breakfast & networking
    [08:45 - 09:40] Registration
    [09:50 - 10:50] …undecided…
    [11:00 - 12:00] Let’s make SQL Fly! [Ramesh Myyappan]
    [12:20 - 13:20] Using Perfmon & Profiler [Brent Ozar]
    [13:20 - 13:40] Lunch & networking
    [14:40 - 15:40] SSIS in SQL Server 2008 [Allan Mitchell]
    [16:00 - 17:00] Report Builder 3 [Andrew Fryer]
    [17:00 - 18:00] SQLBits Shenanigans…
    [18:00 - ??:??] Social

     

    Sunday, 22nd November:

    [07:30 - 10:00] Long Breakfast & Networking
    [10:32 - 13:48] Train back to London, Paddington
    [15:00] Reunited with my amazing family.

     

    I’m hoping to meet a bunch of folks at the conference, so if you are going, let me know. It’s always easier to start a conversation if you’ve already introduced yourself, even if that is only in a ‘online’ sense. So, either leave a comment here or look me up on twitter (@lukehayler). Oh, and if you’re already on twitter and not using the #sqlbits tag for related posts, you should be.

    I’m hunting for social events next….stay tuned.