Tuesday, 7 June 2011

SSRS: Conditional formatting - Using an expression to change chart colour

Dashboards and reports can get very crowded, very quickly and getting meaning full insight from the charts presented, can be a challenge.

In steps conditional formatting!...

In this example i will skip over how you can draw attention to key bits of information in your graphs/charts, but the principle can be applied almost everywhere.

Example:
Here in Pic 1 is a chart mapping the registrations to an online website.
As you can see, it's all over the place and isn't telling us much more than volumes

Pic 1 - My Chart

By dropping into the design and right clicking on the series we want to format (in this example its the registrations) we can then click through to edit the Series Properties:
Pic 2 - Chart in Design
Under the "Fill" tab select  the "Solid" radio button in the top half, then the fx  button next to colour:
Pic 3 - Series Options

In the Expression now we are going to use an IIF statement to decide what colours to use.
If you want something to be either one colour or another, the IIF statement probably suits your needs, howether if you need to put in multiple criteria or ranges, look up the switch function as this probably better suits your needs.

In my example though, I want to highlight the weekends a different colour to weed days as I belive they have different patterns of registration.
To go this I query day_name.value and where it is "Saturday" or "Sunday" then I ask it to be Orange, else I want it to be MidnightBlue.

The expressions format can be seen in pic 4 below:
Pic 4 - Expression Builder
Now this has been set, when I next render the report, I am met with a chart that has much more meaning when looking at it:

Pic 5 - Final Chart
By hilighting the weekends, it allows the viewer to build up a much clearer picture of what is going on.

I hope that was helpfull, there are much more worthy causes out there, but this meant to make you aware of what you can do, for you to then go on and adapt!

T

Monday, 6 June 2011

Cloud Bubble

A close friend of mine who just so happens to be a talented programmer has released his blog : http://www.cloudbubble.co.uk/

I am hoping to work with him on this project as we explore Microsoft's BI offerings, offering step by step tutorials and real world examples...

See you there,

T

Thursday, 2 June 2011

SQL MERGE function...

All of us who have used databases have come accross scenarios that would have been made easier if the MERGE function was avaliable from the start...

It allows you to target a table with some data, and either update it if it allready exists or insert if it doesnt (or any other logic in between)!

Check it out here: http://technet.microsoft.com/en-us/library/bb510625.aspx

(Now is probably a good time to look at Common Table Expressions too! (CTE's))

Enjoy,

T