ElementValue without parameters returns the cell defined by the current tuple.
Query
WITH
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
MEMBER [Measures].[matrix-v] AS [matrix-a].ElementValue()
SELECT
[Geography].[Geo].[Country] on 0,
[Product].[Prod].[Licence] on 1
FROM
[Sales]
WHERE [matrix-v]
Result
|
Canada |
Mexico |
United States |
Venezuela |
France |
Spain |
Switzerland |
Corporate |
0.0 |
0.0 |
768.0 |
0.0 |
0.0 |
0.0 |
144.0 |
Partnership |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
96.0 |
Personal |
0.0 |
0.0 |
0.0 |
0.0 |
4.0 |
3.0 |
8.0 |
Startup |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
Assertion : Cell Equals
WITH
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
SELECT
[Measures].[matrix-a] on Axes
FROM
[Sales]
ElementValue with a tuple as parameters returns the cell defined by the this tuple completed by the context.
Query
WITH
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
MEMBER [Measures].[matrix-v] AS [matrix-a].ElementValue( ([Geography].[Geo].[Spain], [Product].[Prod].[Licence].[Personal]) )
SELECT
[matrix-v] on 0
FROM
[Sales]
Result
Assertion : Cell Equals
WITH
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
MEMBER [Measures].[matrix-v] AS [matrix-a].ElementValue()
SELECT
([Geography].[Geo].[Spain], [Product].[Prod].[Licence].[Personal]) on 0
FROM
[Sales]
WHERE [matrix-v]
Assertion : Cell Equals
WITH
FUNCTION idx(set_, tuple_) AS RANK(tuple_, set_) - 1
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
MEMBER [Measures].[matrix-v] AS [matrix-a]->value( idx([Geography].[Geo].[Country],[Geography].[Geo].[Spain]), idx([Product].[Prod].[Licence],[Product].[Prod].[Licence].[Personal]) )
SELECT
[matrix-v] on 0
FROM
[Sales]
ElementValue with a tuple as parameters returns an empty cell if the Matrix or Vector element cannot be found. Note that a matrix is not a cube, for a matrix there is no hierarchical relation all members of a hierarchy are equal.
Query
WITH
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
MEMBER [Measures].[matrix-v] AS [matrix-a].ElementValue( ([Geography].[Geo].[Madrid], [Product].[Prod].[Licence].[Personal]) )
SELECT
[matrix-v] on 0
FROM
[Sales]
Result
Assertion : Cell Equals
WITH
MEMBER [Measures].[matrix-v] AS NULL
SELECT
[matrix-v] on 0
FROM
[Sales]
Assertion : Cell Equals
WITH
MEMBER [Measures].[matrix-a] AS MatrixA( [Geography].[Geo].[Country], [Product].[Prod].[Licence], [Measures].[Amount] )
MEMBER [Measures].[matrix-v] AS [matrix-a].ElementValue( ([Geography].[Geo].[Spain].parent, [Product].[Prod].[Licence].[Personal]) )
SELECT
[matrix-v] on 0
FROM
[Sales]
ElementValue without parameters returns the cell defined by the current tuple.
Query
WITH
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount] )
MEMBER [Measures].[vector-v] AS [vector-a].ElementValue()
SELECT
NON EMPTY [Geography].[Geo].[Country] on 0
FROM
[Sales]
WHERE [vector-v]
Result
Canada |
Mexico |
United States |
Venezuela |
France |
Spain |
Switzerland |
0.0 |
0.0 |
768.0 |
0.0 |
4.0 |
3.0 |
248.0 |
Assertion : Cell Equals
WITH
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount] )
SELECT
[Measures].[vector-a] on Axes
FROM
[Sales]
ElementValue with a tuple as parameters returns the cell defined by the this tuple completed by the context.
Query
WITH
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount] )
MEMBER [Measures].[vector-v] AS [vector-a].ElementValue( [Geography].[Geo].[Spain] )
SELECT
[vector-v] on 0
FROM
[Sales]
Result
Assertion : Cell Equals
WITH
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount] )
MEMBER [Measures].[vector-v] AS [vector-a].ElementValue()
SELECT
([Geography].[Geo].[Spain]) on 0
FROM
[Sales]
WHERE [vector-v]
Assertion : Cell Equals
WITH
FUNCTION idx(set_, tuple_) AS RANK(tuple_, set_) - 1
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount], INCLUDEEMPTY )
MEMBER [Measures].[vector-v] AS [vector-a]->value( idx([Geography].[Geo].[Country],[Geography].[Geo].[Spain]) )
SELECT
[vector-v] on 0
FROM
[Sales]
ElementValue with a tuple as parameters returns an empty cell if the Matrix or Vector element cannot be found. Note that a Vector is not a cube, for a Vector there is no hierarchical relation all members of a hierarchy are equal.
Query
WITH
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount] )
MEMBER [Measures].[vector-v] AS [vector-a].ElementValue( [Geography].[Geo].[Madrid] )
SELECT
[vector-v] on 0
FROM
[Sales]
Result
Assertion : Cell Equals
WITH
MEMBER [Measures].[vector-v] AS NULL
SELECT
[vector-v] on 0
FROM
[Sales]
Assertion : Cell Equals
WITH
MEMBER [Measures].[vector-a] AS VectorA( [Geography].[Geo].[Country], [Measures].[Amount] )
MEMBER [Measures].[vector-v] AS [vector-a].ElementValue( [Geography].[Geo].[Spain].parent )
SELECT
[vector-v] on 0
FROM
[Sales]