views:

57

answers:

1

I have a table in data base which has column MonthNo ,Year ,MonthValue ,AvgYTD and it has values in

 1 ROW... 1 , 2010 , 2.3 , 4.0  AND

 2 ROW...  2, 2010, 3.3 ,5.0 AND

 3 ROW.. 3, 2010, 3.3, 7.9  

AND I want output in my SSRS.....

WHEN I SELECT MONTH MARCH USING PARAMETER THEN OUTPUT WILL BE....A TABLE AND IT HAS COLUMN

JAN  ,  FEB , MARCH , AVGYTD   and  values in row are .. 

 2.3  ,3.3, 4.3, 7.9

Updates

i am using sql server 2005 and 7.9 is th AvgYTD Value comes from table for selected month march....

i want ...if i select month march then output will be show month value of jan,feb and march and AvgYTD value for only selected month..

thanks,

A: 

Use a matrix, and if SQL 2005, use the InScope function to be able to tell if you're in the SubTotal column. In SQL 2008 you can just put a column in there for the appropriate YTD value.

Edit, to explain it more thoroughly:

Put a Matrix in the report. Use a column group on Year, MonthNo. By default that group will be called matrix1_ColumnGroup1 (or something like that - go to Edit Group to set it to something better). Put a row group on whatever causes a second row to appear.

In the Cell part of the Matrix, use an expression like:

=IIF(InScope("matrix1_ColumnGroup1"), First(Fields!MonthValue.Value), Last(Fields!AvgYTD.Value))
Rob Farley
I dont know how to use Matrix please tell me complete solution i m in trouble from two days
RADHIKA
Start by telling me which version of ssrs you're using, and where 7.9 comes from.
Rob Farley
hi rob, i am using sql server 2005 and 7.9 is th AvgYTD Value comes from table for selected month march....i want ...if i select month march then output will be show month value of jan,feb and march and AvgYTD value for only selected month..thanks,
RADHIKA
I've edited my answer to explain it more thoroughly.
Rob Farley