Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Matrix Help

Author  Topic 

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2008-12-10 : 05:37:22
Hi,

Ive never used a matrix before and im having few problems.

I have a table which looks like this

Subject, Week_no
Maths, 1
Maths, 2
Maths, 3

How could I use a matrix to show:

Subject, Week_no, Week_no, Week_no
Maths, 1, 2, 3

And there are going to be multiple subjects with different counts, so some rows will show less rows than others, and numbers vary some have; 4 and 25 or 1, 2, 6, 8 etc.

Thanks

cipriani1984
Constraint Violating Yak Guru

304 Posts

Posted - 2008-12-11 : 04:18:31
Any ideas anyone?

quote:
Originally posted by cipriani1984

Hi,

Ive never used a matrix before and im having few problems.

I have a table which looks like this

Subject, Week_no
Maths, 1
Maths, 2
Maths, 3

How could I use a matrix to show:

Subject, Week_no, Week_no, Week_no
Maths, 1, 2, 3

And there are going to be multiple subjects with different counts, so some rows will show less rows than others, and numbers vary some have; 4 and 25 or 1, 2, 6, 8 etc.

Thanks

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-11 : 10:37:28
just use this as query

SELECT Subject,Week_no,ROW_NUMBER() OVER(PARTITION BY Subject ORDER BY Week_no) AS Seq
FROM table


then use Subject as row group and seq as column group in matrix and use
=SUM(Fields!Week_no.value)

as expression in data region
Go to Top of Page
   

- Advertisement -