开发者

Reporting services put data from two DataSet rows in one tablix cell

I need to create report with table which looks like this

             Country 1    Country 2    Country 3    Total
Category 1     1(2)         2(1)         5(6)        8(9)
Category 2     2(3)         2(1)         4(0)        8(4)
Category 3     3(2)         2(1)         3(1)        8(4)
Total          6(7)         6(3)         12(7)       24(17)

Report contains data about TFS WI's and has information about current week's WI count and last weeks WI count (in brackets)

Data set on which this report is based on MDX query against TFS warehousw开发者_JAVA百科 cube and has such structure:

Category    Country    Week   Count
   1           1       this     1  
   1           2       this     2
   1           3       this     5    
   1           1       last     2  
   1           2       last     1
   1           3       last     6    

Trouble is, I cann't find a way how to concatenate data about current and last weeks incident count in one cell. I have toyed around with idea to do it in MDX, but with my limited MDX skills I can't see how it could be done.


Rowgroup on Category. Columngroup on Country.

Inside the cell you should be able to have 2 placeholders with the second one in brackets. The first expression should be:

=Sum(iif(Fields!Week.Value = "this", Fields!Count.Value, 0))

The second one should be:

=Sum(iif(Fields!Week.Value = "last", Fields!Count.Value, 0))


In MDX you could create two calcs - this and last week (of course you'll need to change this to work with your cube):

WITH
MEMBER [Measures].[thisWeekCount] AS
    ([Date].[Week].[this], [Measures].[Count])
MEMBER [Measures].[lastWeekCount] AS
    ([Date].[Week].[last], [Measures].[Count])
SELECT
{
    [Measures].[thisWeekCount],
    [Measures].[lastWeekCount]
} ON 0,
{
    ...
} ON 1
FROM [Your Cube]

Then, you can use them within placeholders as jimconstable explained, but without the iif functions.


Thank you all for your answers!

I found out that main problem (reporting services allows only one measure on columns) can be solved by using Analysis server OLE DB provider. There are some drawbacks, like that parameters are not supported, but I can live with this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜