SSRS Reporting Services | Revision of expressions exercise | Use the SWITCH function to categorise directors

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Software ==> SSRS Reporting Services  (99 exercises)
Version ==> SSRS 2012 and later
Topic ==> Revision of expressions  (3 exercises)
Level ==> Average difficulty
Subject ==> SSRS training
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

First create a report called Quantity not quality, and within this create a dataset to show how many films each director has made:

Dataset using grouping

If you're not sure how to group in a dataset in SSRS, see the note below.

The easiest way to apply grouping is probably with the right mouse button: 

Group by tool

You can right-click on the top part of your query to apply grouping.


Now create a table in your report to show this data:

Table of directors and films

Your table doesn't have to look anything like this!


Create a calculated field using the SWITCH function giving a rating for each director using the following rules:

Number of films made Rating
1 One-hit wonder
2-3 Casual director
4-6 Experienced director
7+ Prolific

When you preview your report, you should see something like this:

Directors with ratings

See if you can find the only director whose rating is Prolific (it might not be a surprise when you do).


Close this report down.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post