Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

MS SQL

Posted Jun 27, 2008

Mastering OLAP Reports: Parameterizing Number of "Look Back" Periods with the MDX LastPeriods() Function, Part II - Page 6

By William Pearson

Verification: Preview the Report and Inspect the Effectiveness of Our Modifications and Enhancements

Let’s preview the report to inspect the results of our handiwork.

1.  Click the Preview tab.

DBJ_OLAP_Report.rdl initializes, and the Year prompt becomes enabled.

We note that the Year parameter is once again displaying the ParameterCaptionIndented Label field - something we had already changed to the standard ParameterCaption Label field within the Report Parameters dialog for the respective parameter TimeYear earlier. It is, perhaps, useful to note, at this stage, that the Label field has reset itself to this, the Reporting Services default, when we “declared” the TimeYear query parameter within the TimeMonth dataset, as a part of making the latter cascade properly, based upon the selection we made within the TimeYear picklist. To restore the standard ParameterCaption Label field, we can simply return to the Report Parameters dialog for the TimeYear parameter, and reselect ParameterCaption via the Label field selector, as shown in Illustration 22.


Illustration 22: Adjusting the Label Field, which has Reset to Default ... (Optional)

2.  Click the Preview tab, once again, if you have made the change noted above.

3.  Click the downward pointing arrow on the right side of the Month parameter selector.

We note that only two months appear within the Month parameter picklist - the only populated member months of FY 2005 within the Adventure Works sample cube. Let's try changing the Year at this point to demonstrate further the fact the cascading is working effectively:

4.  Select FY 2004 within the Year parameter picklist.

Once we make a selection within the Year dropdown selector, the next parameter within the cascading chain, Month, becomes enabled, once again.

5.  Click the downward selector button that appears on the right of the Month parameter, as we did before, to expose the parameter picklist, as depicted in Illustration 23.


Illustration 23: The Parameter Picklist Cascades to Display the Member Months of FY 2004

We note that twelve months appear within the Month parameter picklist - the only populated member months of FY 2004 within the Adventure Works sample cube. We can easily see that the Month parameter picklist cascades appropriately, based upon the selection we make in the Year parameter picklist.

6.  Select June 2004 within the Month parameter picklist (the bottom entry appearing within the selector).

Let's verify the operation of the “look back” capability we have added via the No. Months to Report parameter. As we can see, the default of “6” appears in the selector.

7.  Leaving the No. Months to Report parameter selection at default (“6”), click the View Report button in the upper right corner of the Preview tab, to execute the report with current settings.

The report executes, and displays its output within six columns, ranging between June 2004 and January 2004, as shown in Illustration 24.


Illustration 24: The Report Displays a “Look Back” Span of Six Months

Let's perform another quick test of the parameterized “look back” capability.

8.  Click the downward pointing arrow to the immediate right of the No. Months to Report parameter selector.

9.  Select the number “3” within the No. Months to Report parameter picklist.

10.  Click the View Report button in the upper right corner of the Preview tab, to execute the report with current settings.

The report executes, displaying its output, this time, within three columns, ranging between June 2004 and April 2004, as depicted in Illustration 25.


Illustration 25: The Report Displays a “Look Back” Span of Three Months

We therefore see that the “look back” parameter we have put into place, No. Months to Report, accomplishes the intended ends, and enables us to meet the business need expressed by the information consumers. More generally, we can easily see that the Reporting Services 2005 environment, with its graphical design environment, supports easy and flexible design of innovative parameters, which can be based upon a sizable inventory of MDX functions and operators, among other options. Further, we have seen how we can design parameters to cascade, and to otherwise interact in an intuitive, user-friendly fashion. While we might have gone significantly further in designing function-based defaults for cascading parameter picklists, or even more elaborate, dynamically adjusting “look back” ranges, based upon dates we selected, and a host of other possibilities, we assure our client colleagues that, once they understand the basics, we can certainly help them to further enjoy the myriad more advanced capabilities that are exposed within the current version of Reporting Services.

11.  Experiment further with the report, if desired.

12.  Select File -> Save All to save our work to this point.

13.  Select File -> Exit to leave the design environment, when ready.

Conclusion ...

In this article, we concluded another extended examination, which we began in Mastering OLAP Reports: Parameterizing Number of “Look Back” Periods with the MDX LastPeriods() Function, Part I, of parameters in Reporting Services 2005. We continued toward our primary objective of getting hands-on exposure to parameterizing LastPeriods() within the sample OLAP report that we cloned in the first half of the article, where we began our practice session by setting up a scenario within which to work with a basic OLAP report in exposing the steps involved.

We picked up, in this article, with the clone of an existing sample report, containing a matrix data region, which we had created, and structurally modified further for our practice session, in Part I. We also briefly recounted an overview of the MDX LastPeriods() function we had performed in the first half of this article, discussing details of the use we intended for the function to support the stated reporting needs of a hypothetical client. In so doing, we touched upon general concepts surrounding the parameterization of MDX functions in general, and the LastPeriods() function specifically.

In this, the second half of our article, we continued our practice session by reviewing and ensuring the adequacy of the datasets (automatically created when we added the required query parameters to support date and function parameterization in Part I) to support report parameters and meet the stated business requirements. We next added syntax to the Month dataset query to enforce cascading, based upon the selection made for the Year parameter by an information consumer at runtime. Finally, we leveraged the MDX LastPeriods() function, containing index and Month parameter placeholders, to provide the “look back” capability requested by our client. At appropriate junctures throughout both Part I and Part II of this article, we discussed the interaction between the various components in supporting the runtime parameter that the end consumer sees, as well as discussing the results obtained with the development techniques that we exploited.

» See All Articles by Columnist William E. Pearson, III

Discuss this article in the MSSQL Server 2000 Reporting Services Forum.



MS SQL Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM


















Thanks for your registration, follow us on our social networks to keep up-to-date