Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Jeje - EXISTS() with COUNT works. Needs to add SET to it.

瀏覽次數:0 次
跳到第一則未讀訊息

Prasad

未讀,
2006年8月1日 下午2:16:012006/8/1
收件者:
Hi Jeje,

I am able to get the count working now. See the MDX below. I have one filter
in my "WHERE" clause - Local Market with "NE - North East" region.

WITH
MEMBER[Measures].[Count] AS
'count(exists([Servicing Provider].[Hierarchy].[TAX_ID_NBR].members,
{[Time].[Hierarchy].[Year].&[2006]}, "SALES MSR GRP"))'

SELECT
{[Measures].[Count]}ON COLUMNS FROM [SALES Model]
WHERE
([Local Market].[Hierarchy].[REGION_CD].&[NE])

Now, i want to add one more region "SE - South East" to the 'WHERE CLAUSE".
I am getting the following error.

Error: The 'Hierarchy' hierarchy appears more than once in the tuple.

WITH
MEMBER[Measures].[Count] AS
'count(exists([Servicing Provider].[Hierarchy].[TAX_ID_NBR].members,
{[Time].[Hierarchy].[Year].&[2006]}, "SALES MSR GRP"))'

SELECT
{[Measures].[Count]}ON COLUMNS FROM [SALES Model]
WHERE
([Local Market].[Hierarchy].[REGION_CD].&[NE], [Local
Market].[Hierarchy].[REGION_CD].&[SE])

Please help with the syntax. I tried creating a set for the Local Market
with 'SE' & 'NE' and included it in my "WHERE". But the stmt returned 0.

Thanks,

Prasad.


ZULFIQAR SYED

未讀,
2006年8月19日 下午1:35:582006/8/19
收件者:
Hi Prasad,

Here is a sample query based on adventure works where it adds couple of
promotion member items to the where clause. This might you in adding
extra region in your where clause.

Thanks

WITH
MEMBER MEASURES.X AS
[Promotion].[Promotion].&[1]
SELECT
(
[Date].[Calendar].[Calendar Semester].&[2003]&[2]
.CHILDREN
)
ON 1,
(
[Measures].[Reseller Order Quantity]
,

[Product].[Product Categories].[Category]
)
ON 0
FROM
[Adventure Works]

WHERE
{
[Promotion].[Promotion].&[1]
, [Promotion].[Promotion].&[2]

}

HTH..

ZULFIQARSYED

HTTP://ZULFIQAR.TYPEPAD.COM

Prasad

未讀,
2006年8月21日 下午1:13:012006/8/21
收件者:
Hi Syed,

Your suggestion works. Thank You.

I found the problem in my statement. I was referring to multiple members
(more than one) from the same dimension in the tuple. That is why i got the
error.

Once i made it a SET, the problem is resolved.

"ZULFIQAR SYED" wrote:

> Hi Prasad,
>
> Here is a sample query based on adventure works where it adds couple of
> promotion member items to the where clause. This might you in adding
> extra region in your where clause.
>
> Thanks
>
> WITH
> MEMBER MEASURES.X AS
> [Promotion].[Promotion].&[1]
> SELECT
> (
> [Date].[Calendar].[Calendar Semester].&[2003]&[2]

> ..CHILDREN

0 則新訊息