![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
| With Set [Include Months] as |
| ... |
#3
| |||
| |||
|
|
This is a well-known limitation of the Distinct Count aggregation, that will be removed in SQL Server 2005. There are some possible approaches that avoid using a Distinct Count Measure. For your case, assuming that the number of distinct company_id isn't prohibitively large, you can create a hidden dimension like [Company], with a [CompanyID] leaf level. This joins to the company_id field of the fact table. Then, build a Named Set from the user-specified months, and use it to compute [Distinct Company]: With Set [Include Months] as '{[Flight Month].[Month Name].[Oct 2003], [Flight Month].[Month Name].[Nov 2003], [Flight Month].[Month Name].[Dec 2003]}' Member [Measures].[Distinct Company] as 'NonEmptyCrossJoin([Company].[CompanyID].Members, {[Segment].CurrentMember}, [Include Months], 1).Count' Select {[Measures].[Distinct Company]} on columns, {[Segment].[All Segment].[Segment1], [Segment].[All Segment].[Segment2], [Segment].[All Segment].[Segment3], [Segment].[All Segment].[Segment4]} on rows from Flight_BA Here is an earlier post that describes this approach: http://groups.google.com/groups?selm...sslab.com&oe=U TF-8&output=gplain .. The only way to get what you want is to write the query yourself, and you can't use DistinctCount(). Something like NonEmptyCrossJoin ( {[Product Name].Members}, {[Time].[1997].[Q1], [Time].[1997].[Q2] }, {[Store].CurrentMember}, {[Customer].CurrentMember}, ... // other dimensions' current members ,1 // return just the product dimension ).Count .. - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
![]() |
| Thread Tools | |
| Display Modes | |
| |