NextMember

Using the order of members existing in an Essbase database outline, the MDX NextMember function returns the next member along the same generation or level.

Syntax

member.NextMember [( layertype ) ]
NextMember ( member [,layertype ] )

Parameters

member

The starting member from which .NEXTMEMBER counts one member forward.

layertype

GENERATION or LEVEL. The default is Generation.

Notes

  • If the next member is not found, this function returns an empty member. For example, using Sample Basic, these would return an empty member: Qtr4.nextmember and Year.nextmember.

  • When multiple hierarchies are enabled, this function returns NULL when the source member is in one hierarchy and the result member belongs to a different hierarchy.

Example

Example 1

The following expression:

 [Jun].nextmember

returns the member that is one step further than Jun:

[Jul]

Example 2

The following query

/* 
For January, PrevMember doesn't exist
For December, NextMember doesn't exist
*/

WITH 

MEMBER 
 [Measures].[Delta from Previous Month] 
AS 
 ' [Measures].[Sales] - 
  ([Measures].[Sales],[Year].CurrentMember.PrevMember)
 '

MEMBER [Measures].[Delta from Next Month]
AS
 ' [Measures].[Sales] - 
  ([Measures].[Sales], [Year].CurrentMember.NextMember)
 '

SELECT
 { [Measures].[Sales], 
   [Measures].[Delta from Previous Month], 
   [Measures].[Delta from Next Month] 
 }
ON COLUMNS,

 [Year].Levels(0).Members
ON ROWS

FROM Sample.Basic
WHERE 
 (
  [Scenario].[Actual], 
  [Market].[East], 
  [Product].[100]
 )

returns the grid:

Table 4-116 Output Grid from MDX Example

(axis) Sales Delta from Previous Month Delta from Next Month
Jan 2105 2105 44
Feb 2061 -44 -65
Mar 2126 65 -132
Apr 2258 132 -89
May 2347 89 -278
Jun 2625 278 -110
Jul 2735 110 62
Aug 2673 -62 311
Sep 2362 -311 268
Oct 2094 -268 28
Nov 2066 -28 -222
Dec 2288 222 2288

See Also

PrevMember

Lead