![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I need help to build a statement in MDX for Analysis Services. I'd like to calculate the average grade for a certain exam. I've got 2 measures: the number of people who made the exam and the sum of all grades. now the average would be: [Measures].[Sum Grades] / [Measures].[No of attendends] Every attendend who refuses to make the exam after seeing the questions gets grade:0! I want to exclude those people in my average calculation!!!! So I need an MDX statement which does something like this: [Measures].[Sum Grades] / ([Measures].[No of attendends] without those who have grade 0) Can anybody please help me with my statement! Thanks |
#3
| |||
| |||
|
|
Hi, I need help to build a statement in MDX for Analysis Services. I'd like to calculate the average grade for a certain exam. I've got 2 measures: the number of people who made the exam and the sum of all grades. now the average would be: [Measures].[Sum Grades] / [Measures].[No of attendends] Every attendend who refuses to make the exam after seeing the questions gets grade:0! I want to exclude those people in my average calculation!!!! So I need an MDX statement which does something like this: [Measures].[Sum Grades] / ([Measures].[No of attendends] without those who have grade 0) Can anybody please help me with my statement! Thanks |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
If you're using AS 2005, you could create a new named query on the fact table, with where clause: Grade = 0. If a measure group is added with this named query as its fact table, records with Grade = 0 will now be excluded. - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#6
| |||
| |||
|
| SQL Server 2005 Books Online |
![]() |
| Thread Tools | |
| Display Modes | |
| |