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)
 count distinct

Author  Topic 

isaac.bs
Starting Member

3 Posts

Posted - 2008-04-24 : 11:29:17
I have a dimension of Pilots, and a fact table of minutes that each pilot flights every month

position_id position_desc
1, captain
2, first officer

pilot_id pilot_desc
1, pilot1
2, pilot2
3, pilot3
4, pilot4

date pilot_id plane_id position_id minutes
jan, 1, 100, 1, 9000
jan, 2, 200, 1, 8500
jan, 3, 200, 2, 10000
feb, 1, 100, 1, 8000
feb, 2, 200, 1, 7600
feb, 3, 300, 1, 9200
feb, 5, 500, 2, 5000
feb, 4, 400, 1, 8300


Is there a way through MDX to get a calculated measure that tells me the average number of hours flought during the month by captains?? For example

jan ((9000+8500)/2)/60 = 145.8
feb ((8000+7600+9200+8300)/4)/60 = 137.9

The filter of captain is easy but how do I count how many distinct captains (there can be several registers per month per pilot) really had activity during the month?

Thanks in advance
   

- Advertisement -