Re: How to extract the underlying MDX
- From: "Rose" <rose.say@xxxxxxxxx>
- Date: 13 Jan 2006 09:14:49 -0800
1) The report parameter is coming from AS indeed, and Reporting
Services does auto-generate a MDX that retrieves a list of the valid
values as you described. All is well, except that the consumer
web-application can invoke a report with a URL access without first
validating if that's an valid Dimension member.
Yes, you are absolutely right, the error is from Reporting Services,
because the parameter value received is not in the available value
list!
Now, if I can have another parameter that is accepting the value and is
not bound to the available value list, and when processing a call with
an invalid value, the error displayed is now
"Query (1, 598) The restrictions imposed by the CONSTRAINED flag in the
STRTOSET function were violated. "
Now, that's an AS error, because [Product].[Category].&[5] (a
non-existing Dimension Member) has been used to make such a query:
WITH MEMBER [Measures].[Profit] AS
'[Measures].[Sales Amount]-[Measures].[Standard Product Cost]'
SELECT NON EMPTY { [Measures].[Internet Sales Amount],
[Measures].[Internet Total Product Cost],
[Measures].[Internet Order Quantity] } ON COLUMNS,
NON EMPTY { ([Sales Reason].[Sales Reason].[Sales Reason].ALLMEMBERS *
[Sales Territory].[Sales Territory Group].[Sales Territory
Group].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME,
[Sales Reason].[Sales Reason].[Sales Reason].KEY,
[Sales Territory].[Sales Territory Group].[Sales Territory Group].KEY
ON ROWS
FROM ( SELECT ( STRTOSET('[Product].[Category].&[5]', CONSTRAINED) ) ON
COLUMNS FROM [Adventure Works])
WHERE ( IIF( STRTOSET('[Product].[Category].&[5]', CONSTRAINED).Count =
1,
STRTOSET('[Product].[Category].&[5]', CONSTRAINED),
[Product].[Category].currentmember ) )
In your posting, 'IIF(VBA!ISERROR(STRTOVALUE("MEASURES.[THIS WONT
WORK]")), 1,0)' is able to catch an invalid MEASURE. I suspect maybe
the following can help me to detect invalid dimension members?
WITH MEMBER MEASURES.TEST AS
'IIF(VBA!ISERROR(STRTOSET("[Product].[Category].&[1]",
CONSTRAINED).COUNT),1,0)'
MEMBER MEASURES.TEST2 AS
'IIF(VBA!ISERROR(STRTOSET("[Product].[Category].&[5]",
CONSTRAINED).COUNT),1,0)'
SELECT {MEASURES.TEST, MEASURES.TEST2} ON 0 FROM [Adventure Works]
Then, if I have prepared a 'DEFAULT' Dimension Member
([Product].[Category].&[-999] in the example below) to handle all the
invalid calls, then I may be able to tweak the MDX to the following?
WITH MEMBER [Measures].[Profit] AS '[Measures].[Sales
Amount]-[Measures].[Standard Product Cost]'
SELECT NON EMPTY { [Measures].[Internet Sales Amount],
[Measures].[Internet Total Product Cost], [Measures].[Internet Order
Quantity] } ON COLUMNS,
NON EMPTY { ([Sales Reason].[Sales Reason].[Sales Reason].ALLMEMBERS )
} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME,
[Sales Reason].[Sales Reason].[Sales Reason].KEY, [Sales
Territory].[Sales Territory Group].[Sales Territory Group].KEY ON ROWS
FROM ( SELECT ( IIF( STRTOSET(@ProductCategory).Count = 1,
STRTOSET(@ProductCategory, CONSTRAINED), [Product].[Category].&[-999] )
) ON COLUMNS
FROM [Adventure Works]) WHERE ( IIF( STRTOSET(@ProductCategory).Count =
1, STRTOSET(@ProductCategory, CONSTRAINED),
[Product].[Category].currentmember ) )
2. Chris, what's the function of the CONSTRAINED flag?
I found that if I include this CONSTRAINED flag into IIF(
STRTOSET(@ProductCategory, CONSTRAINED).Count = 1, the query above
stops working.
.
- Follow-Ups:
- Re: How to extract the underlying MDX
- From: Chris Webb
- Re: How to extract the underlying MDX
- References:
- How to extract the underlying MDX
- From: Rose
- Re: How to extract the underlying MDX
- From: Rose
- How to extract the underlying MDX
- Prev by Date: SSAS 2005: Contains function does not work
- Next by Date: Re: Member Property variable in Time ?
- Previous by thread: Re: How to extract the underlying MDX
- Next by thread: Re: How to extract the underlying MDX
- Index(es):
Relevant Pages
|