SSRS: Time-type parameterization based on time-period parameters for MDX queries and time calendar date picker

Source: Internet
Author: User
Tags empty

Today I see a problem in the goodness of the day, and if I'm not mistaken, it should mean, for example, selecting a time period in a report and then finding the SUM of some Measure for that time period. And at the same time, the SUM of the same Measure between the points corresponding to the last year of the two points is calculated.

For example, the currently selected point of time is January 8, 2004, and the end point is March 1, 2004. Not only does the sum of a measure in this time period be required, but it also requires a measure sum for the period from January 8, 2003 to March 1, 2003. That is, the time period is dynamic, depending on the input of the two time periods to determine the year and the previous year of the calculation.

This has a few small knowledge points, so summed up a bit, first look at the results of the following.

There is also the effect of using Date Picker (Note that if you use a Calendar control, then the types of StartDate and EndDate are date/time types)-

Design of non-Date Picker parameters

Check the Cube to verify that the query results are the same.

With member [Measures]. [Reseller Sales Amount of Period]
As
SUM (
 [date].[ Calendar]. [Date].&[20040108]:[date]. [Calendar]. [date].&[20040301]
, [measures].[ Reseller Sales Amount]
   ) member
[measures].[ Reseller Sales Amount of last Period]
as
SUM (
 [date].[ Calendar]. [Date].&[20030108]:[date]. [Calendar]. [date].&[20030301]
, [measures].[ Reseller Sales Amount]
   )
SELECT NON empty{[measures].[ Reseller Sales Amount of Period],
 [measures].[ Reseller Sales Amount of Last Period]} on COLUMNS,
NON EMPTY {([product].[ Category]. [Category]. ALLMEMBERS)} on ROWS from
[step-by-step]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.