Re: Odd BeginRange/EndRange behavior

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Hanying Feng [MS] (hfeng_at_online.microsoft.com)
Date: 04/29/04


Date: Wed, 28 Apr 2004 17:00:09 -0700

This is by design.

The BeginRange's position must be preceding EndRange's position on an axis.
If your BeginRange is 1 and EndRange is 40, then the BeginRange's position
on axis 0 is 1, and EndRange's position on axis 0 is 0, this is not going to
work. Imagine in a two-dimensional cellset, BeginRange and EndRange define a
rectangle in this space. All cells returned will fall into this rectangle.

BeginRange and EngRange returns smaller set of cells than you expected is
also for the same reason. In your case, BeginRange=28, EndRange=60, then you
are getting the first column of cells starting from row 7 to row 15, and
there are exactly two cells in this range.

Thanks,
Hanying

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
"summer_porch" <summer_porch@hotmail.com> wrote in message
news:e$yxnTbIEHA.2844@tk2msftngp13.phx.gbl...
> I've been playing with the XMLA Sample VB application to determine how
> BeginRange and EndRange work and what caching it does of results and found
a
> series of odd behaviors.
>
> I inserted additional properties in the ExecuteQuery Function in the
> xlsXmlDataAccess.vb file to add BeginRange and EndRange properties.
>
>         m_Properties.SetNameValue(cst_strBeginRange, "1")
>         m_Properties.SetNameValue(cst_strEndRange, "40")
>
> The Query, below, produces approx 256 rows and 4 columns. The natural
> boundary for each row is a factor of 4.
>
> What I found is as follows:
>    - For EndRange values of 20, 40 or 60 any BeginRange not a multiple of
4
> fails an error "The specified range rowset is not valid".
>
>       So in this case a BeginRange of  -1, 0, 4, 8, 12, .. work, but
> 1,2,3.,5,6,7,.9,10, 11 all fail with the above error.
>
>  -  If the EndRange is -1 (all) then a BeginRange works (e.g. 1 to -1).
>
> - The actual cell ordinals returned are not what I expected.
>        > Begin = 28 to End = 60 only returned CellOrdinals 27, 31
>        > Begin = -1 to End = 60 returned a CellOrdinals -1 (!), plus 15,
23,
> 27, 31
>        > Begin = -1 to End -1 returned CellOrdinals in the 0-60 range of
0,
> 3, 5, 6, 10, 14, 16, 22, 24, 26, 28, ..
>
> This would suggest that the cells returned for other than the complete
> CellSet (-1, -1) are incomplete. I can think of no explanation for the
> variance in the results.
>
> Query:
>
> SELECT
>        NON EMPTY CROSSJOIN( DISTINCT( { [Time].[1997].CHILDREN } ),
> DISTINCT( { [Measures].[Unit Sales] } ) )  ON COLUMNS,  NON EMPTY
> GENERATE( DISTINCT( TOPCOUNT( DISTINCT( { [Store].[Store
Name].MEMBERS } ),
> 10, ( [Measures].CURRENTMEMBER ) ) ), CROSSJOIN( {
[Store].CURRENTMEMBER },
> GENERATE( DISTINCT( TOPCOUNT( DISTINCT( { [Customers].[Name].MEMBERS } ),
> 10, ( [Measures].[Store Sales] ) ) ), CROSSJOIN( {
> [Customers].CURRENTMEMBER }, DISTINCT( TOPPERCENT( DISTINCT( {
> [Product].[Product Name].MEMBERS } ), 10, ( [Measures].[Store
> Cost] ) ) ) ) ) ) )  ON ROWS
> FROM [Sales]
> CELL PROPERTIES VALUE, FORMATTED_VALUE, FONT_NAME, FORE_COLOR, BACK_COLOR,
> FONT_SIZE, FONT_FLAGS
>
>


Relevant Pages

  • Re: Odd BeginRange/EndRange behavior
    ... asking for exactly a range of cells can mean that the server doesn't have ... > While it would be possible to do an execute with Begin/EndRange only to ... BeginRange and EndRange ...
    (microsoft.public.data.xmlanalysis)
  • Re: Performance and BeginRange EndRange?
    ... How to effectively use BeginRange / EndRange .. ... The MDX query returns 100,000 rows. ... and then based row-column values set Beginrange / Endrange ...
    (microsoft.public.data.xmlanalysis)
  • How to effectively use BeginRange / EndRange .. for records paging?
    ... How to effectively use BeginRange / EndRange .. ... The MDX query returns 100,000 rows. ... and then based row-column values set Beginrange / Endrange ...
    (microsoft.public.data.xmlanalysis)
  • do something every 1000 records or so
    ... Ok, this could be a perfect exam question, but it isn't and i need a ... in a function i get 2 int parameters: ... public Vector findRecords(int beginRange, int endRange) ...
    (comp.lang.java.programmer)