Re: How to find out which members are selected from the mdx query level
- From: mkiewra@xxxxxxxxxxxxxxx
- Date: 12 Oct 2005 03:44:31 -0700
Hello again:
I'm afraid that I did not express myself clearly.
The problem is that I cannot assume the selected time periods are known
nor
construct the query, because my client works with ProClarity.
ProClarity permits the user to select members in each dimension and to
specify the dimension location (row, column or slice). Once this
information is obtained, the ProClarity builds the MDX query that is
sent to the OLAP server. The server response is read by ProClarity and
presented to the user as a data matrix or diagram. It means that I
cannot change MDX query built by the ProClarity Software. The only
thing I can do is to provide calculated members and hide measures.
The idea I had was to hide cube measures (for example units) and to
define calculated members (for example units2). This measure should
behave in the following way:
iif([RegularClients].CurrentMember.Name<>'Regular',
[Measures].[Units],
([Measure].[Units],[Store].CurrentMember,...,[Customer].[RegularCalculatedMember]))
where
[Customer].[RegularCalculatedMember] ought to contain definition
similar to the expression given by Deepak:
'Aggregate(Filter([Customers].[Name].Members,
Count(NonEmptyCrossJoin([SelectedMonths],
{[Customers].CurrentMember}, {[Measures].[Unit Sales]}, 1))
= Count([SelectedMonths])))'
BUT THE PROBLEM IS: how to obtain the set: [SelectedMonths]. This set
(or rather its equivalent) is hidden among the MDX query generated by
the ProClarity, but I do not know how I can access it from the
calculated member definition.
Obviously, if I could replace ProClarity with the application I wrote,
the solution given by Deepak would fit ideally.
I hope that this explanation is clear enough.
Regards,
Maciej Kiewra
> Assuming that the selected time periods are defined in the
> [SelectedMonths] Named Set, this Foodmart Sales query defines [Regular]
> and [Irregular] Customer calculated members, based on fact records
> existing in all periods:
>
> >>
> With Set [SelectedMonths] as
> '{[Time].[1997].[Q1].[1], [Time].[1997].[Q2].[5],
> [Time].[1997].[Q3].[9]}'
> Member [Customers].[All Customers].[Regular] as
> 'Aggregate(Filter([Customers].[Name].Members,
> Count(NonEmptyCrossJoin([SelectedMonths],
> {[Customers].CurrentMember}, {[Measures].[Unit Sales]}, 1))
> = Count([SelectedMonths])))'
> Member [Customers].[All Customers].[Irregular] as
> 'Aggregate(Filter([Customers].[Name].Members,
> Count(NonEmptyCrossJoin([SelectedMonths],
> {[Customers].CurrentMember}, {[Measures].[Unit Sales]}, 1))
> < Count([SelectedMonths])))'
>
> Select [Measures].Members on columns,
> {[Customers].[All Customers].[Regular],
> [Customers].[All Customers].[Irregular]} on rows
> from Sales
> >>
>
>
> - Deepak
>
> Deepak Puri
> Microsoft MVP - SQL Server
>
> *** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: How to find out which members are selected from the mdx query level
- From: Deepak Puri
- Re: How to find out which members are selected from the mdx query level
- From: jasonaeiou@xxxxxxxxx
- Re: How to find out which members are selected from the mdx query level
- References:
- Prev by Date: Re: Distinct count
- Next by Date: Re: Distinct count
- Previous by thread: Re: How to find out which members are selected from the mdx query level
- Next by thread: Re: How to find out which members are selected from the mdx query level
- Index(es):
Relevant Pages
|