Xmla.Dataset Class
This class implements an XML/A multidimensional Dataset object.
You do not need to instantiate objects of this class yourself.
Rather, the Xmla class will instantiate this class
to convey the result of the executeMultiDimensional method
(see executeMultiDimensional()),
and possibly the execute method.
(Note that the execute() instantiates either the
Xmla.Rowset or the Xmla.Dataset class
depending on the value of the Format property in the options passed to the execute() method.)
An instance of the Xmla.Dataset class may be returned immediately as return value from these methods when doing a synchronous request.
In addition, the Xmla.Dataset object is available in the eventdata passed to any registered listeners
(see addListener()).
Constructor
Xmla.Dataset
-
doc
Parameters:
-
docDOMDocumentThe responseXML result returned by server in response to a
Executerequest.
Item Index
Methods
Properties
- AXIS_CHAPTERS static
- AXIS_COLUMNS static
- AXIS_PAGES static
- AXIS_ROWS static
- AXIS_SECTIONS static
- AXIS_SLICER static
Methods
axisCount
()
Int
Get the number of proper axes in this Dataset. This is the number of axes that appears in the SELECT list, and excludes the slicer axis.
Returns:
cellOrdinalForTupleIndexes
-
A
Calculate the cellset ordinal for the argument tuple indexes.
This method accepts a variable number of tuple indexes. One integer argument must be passed for each proper axis (excluding the slicer axis). Each integer arguments represent the index of a tuple on the respective axis.
The arguments must be specified by descending axis order. So if the data set has two axes (a row and a column axis), this method expects the tuple index of a tuple on the row axis first, and after that, the tuple index on the column axis.
The method returns an integer that represents the ordinal of the cell identified by the tuples specified by the tuple index arguments.
One could use this ordinal as argument to the getByOrdinal() method of this Dataset's Cellset.
Instead of calling this method and passing the result into the Cellsets getByOrdinal() method,
you can call the getByTupleIndexes() method of this Dataset's Cellset.
Parameters:
-
AIntvariable number of integer tuple indexes. Tuple indexes should be passed in descending order of axes.
Returns:
Xmla.Dataset.Cellset that belongs to the tuples identified by the arguments.
close
()
Cleanup this Dataset object.
fetchAsObject
()
Object
Gets all of the XML data into one JS object. The object consists of the following members:
axes: An array of objects that represent the query axes (but not the slicer axis). Each axis has apositionsmember which is an array of tuples, and ahierarchiesmember, which is an array of hierarchies.slicerAxis: An object that represents the slicer axis, or null if there is no slicer axis.cells: An array of cell objects, representing the cellset.
Returns:
getAxis
-
nameOrIndex
Get the axis specified by the argument index or name.
If the axis does not exist, an INVALID_AXIS exception is thrown.
To prevent an exception from being thrown, you should call the hasAxis() method to determine if the axis exists.
Alternatively, you can call axisCount(), and use an integer argument between zero (inclusive) and axis count (exclusive).
Parameters:
-
nameOrIndexString | intFor int arguments, a value of 0 up to the number of axes. You can also use one of the
AXIS_xxxconstants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the formAxisNwhere N is an ordinal that identifies the axis.
Returns:
Xmla.Dataset.Axis object that corresponds to the argument.
getCellset
()
Xmla.Dataset.Cellset
Get the Cellset object.
Returns:
Xmla.Dataset.Cellset object.
getChapterAxis
()
Xmla.Dataset.Axis
Get the Chapter axis. This is the fifth axis, and has ordinal 4. If the chapter axis doesn't exist, an INVALID_AXIS exception is thrown.
To prevent an exception from being thrown, you should call the hasChapterAxis() method to determine if the axis exists.
Returns:
Xmla.Dataset.Axis object.
getColumnAxis
()
Xmla.Dataset.Axis
Get the Column axis. This is the first axis, and has ordinal 0. If the column axis doesn't exist, an INVALID_AXIS exception is thrown.
To prevent an exception from being thrown, you should call the hasColumnAxis() method to determine if the axis exists.
Returns:
Xmla.Dataset.Axis object.
getPageAxis
()
Xmla.Dataset.Axis
Get the Page axis. This is the third axis, and has ordinal 2. If the page axis doesn't exist, an INVALID_AXIS exception is thrown.
To prevent an exception from being thrown, you should call the hasPageAxis() method to determine if the axis exists.
Returns:
Xmla.Dataset.Axis object.
getRowAxis
()
Xmla.Dataset.Axis
Get the Row axis. This is the second axis, and has ordinal 1. If the row axis doesn't exist, an INVALID_AXIS exception is thrown.
To prevent an exception from being thrown, you should call the hasRowAxis() method to determine if the axis exists.
Returns:
Xmla.Dataset.Axis object.
getSectionAxis
()
Xmla.Dataset.Axis
Get the Section axis. This is the fourth axis, and has ordinal 3. If the section axis doesn't exist, an INVALID_AXIS exception is thrown.
To prevent an exception from being thrown, you should call the hasSectionAxis() method to determine if the axis exists.
Returns:
Xmla.Dataset.Axis object.
getSlicerAxis
()
Xmla.Dataset.Axis
Get the Slicer axis. This is the axis that appears in the WHERE clause of the MDX statement.
Returns:
Xmla.Dataset.Axis object.
hasAxis
-
nameOrIndex
Determine if the axis specified by the argument exists.
Parameters:
-
nameOrIndexString | intFor int arguments, a value of 0 up to the number of axes. You can also use one of the
AXIS_xxxconstants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the formAxisNwhere N is an ordinal that identifies the axis.
Returns:
true if the specified axis exists, false if it doesn't exist.
hasChapterAxis
()
Boolean
Determine if the chapter axis exists.
Returns:
true if the chapter axis exists, false if it doesn't exist.
hasColumnAxis
()
Boolean
Determine if the column axis exists.
Returns:
true if the column axis exists, false if it doesn't exist.
hasPageAxis
()
Boolean
Determine if the page axis exists.
Returns:
true if the page axis exists, false if it doesn't exist.
hasRowAxis
()
Boolean
Determine if the row axis exists.
Returns:
true if the row axis exists, false if it doesn't exist.
hasSectionAxis
()
Boolean
Determine if the section axis exists.
Returns:
true if the section axis exists, false if it doesn't exist.
hasSlicerAxis
()
Boolean
Determine if the slicer axis exists.
Returns:
true if the slicer axis exists, false if it doesn't exist.
Properties
AXIS_CHAPTERS
Int
final
static
Can be used as argument for getAxis() to get the fifth axis (the chapters axis).
Alternatively you can simply call getChapterAxis()
Default: <code>4</code>
AXIS_COLUMNS
Int
final
static
Can be used as argument for getAxis() to get the first axis (the column axis).
Alternatively you can simply call getColumnAxis()
Default: <code>0</code>
AXIS_PAGES
Int
final
static
Can be used as argument for getAxis() to get the third axis (the page axis).
Alternatively you can simply call getPageAxis()
Default: <code>2</code>
AXIS_ROWS
Int
final
static
Can be used as argument for getAxis() to get the second axis (the row axis).
Alternatively you can simply call getRowAxis()
Default: <code>1</code>
AXIS_SECTIONS
Int
final
static
Can be used as argument for getAxis() to get the fourth axis (the section axis).
Alternatively you can simply call getSectionAxis()
Default: <code>3</code>
AXIS_SLICER
String
final
static
Can be used as argument for getAxis() to get the slicer axis
(the axis that appears in the WHERE clause of an MDX-SELECT statement).
Alternatively you can simply call getSlicerAxis()
Default: <code>SlicerAxis</code>
