Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By : Abolfazl Radgoudarzi, Reza Rad
Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By: Abolfazl Radgoudarzi, Reza Rad

Overview of this book

Table of Contents (19 chapters)
Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding parameters to a report


In this example, we will add the year and month parameters to the report generated in the previous section. You need to perform the following steps after the execution of the previous example to add parameters to a report:

  1. Open the Sales by Product and Territory reports that were created in the previous example, and in the Report Data pane, right-click on Dataset and select Add Dataset.

  2. In the Dataset Properties window, rename the dataset to Years.

  3. Select the Use dataset embedded in my report option. Choose Data source as AdventureWorksDW2012. Then, in the query box, type in the following query to fetch all years from the FactInternetSales table:

    SELECT       distinct (OrderDateKey/10000) as [Year]
    FROM            FactInternetSales

    The following screenshot shows the Dataset Properties window:

  4. Close the Dataset Properties window and then right-click on DataSet1 and select Query.

  5. In the query designer window, add the following script line at the end...