简体   繁体   中英

QTD MDX calculated value displaying differently on SSRS than SSAS

I have created an SSAS cube in SQL 2005 and included calculated members for MTD , QTD as well as YTD .

With QTD measure I actually want to get the total over all 3 months of the quarter, not just the up-to-date value.

Now when I browse the cube itself the number for the QTD measure is correct (total of all 3 months of the quarter) irrespective of what month of the quater do I pass as a parameter, but the report which pulls data from the cube shows the up-to-date value not the total of all 3 months. ie my report gives me the correct value only when I select the last month of the quarter. My report displays Sales targets (Committments) by the way. I wonder why is the report showing different values for this calculated field as compared to the cube? Below is the expression I used to calculate the total over all months of the quarter.

Sum(QTD([DimTime].[Hierarchy].Parent),[Measures].[Commitment])

Please help.

Thanks, Lungisa Dotye

After struggling with this I decided to clear the data grid, removing all the cube fields from the report data or query. I added them back one by one keeping track of the cube values and I noticed that data actually matches what's on the cube browser until when I added the field which details the number of days for each month of the quarter. With this field added the behavior of data changed, I think SSRS automatically drills down to a quarter-to-date level and disregarding the targets for the upcoming months of the quarter. I then decided to create a calculated field for "number of days" on the report level and exclude it from the query fields. And that solved my problem.

I know this may not be an effective solution but for now it worked.

Thanks, Lungisa Dotye

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM