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:
- 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.
- In the Dataset Properties window, rename the dataset to
Years
. - 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 ...
Get Microsoft SQL Server 2014 Business Intelligence Development: Beginner’s Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.