HypGetAncestor

Data source types: Essbase

Description

HypGetAncestor() returns the ancestor at any specific generation/level for the specified member.

Syntax

HypGetAncestor (vtSheetName, vtMemberName, vtLayerType, intLayerNum, vtAncestor)

ByVal vtSheetName As Variant

ByVal vtMemberName As Variant

ByVal vtLayerType As Variant

ByVal intLayerNum As Integer

ByRef vtAncestor As Variant

Parameters

vtSheetName: For future use. Currently the active sheet is used.

vtLayerType: Specify either “Gen” or “Level”. If vtLayerType is Null or Empty, Gen is taken as default.

vtMemberName: Specify a member name. Required field.

intLayerNum: Specify the Level/Generation number. Required Field.

vtAncestor: Output. Contains the ancestor name on successful execution of the macro.

Return Value

Returns 0 if successful; otherwise, returns the appropriate error code.

Example

Declare Function HypGetAncestor Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtMemberName As Variant, ByVal vtLayerType As Variant, ByVal intLayerNumber As Integer, ByRef vtAncestor As Variant) As Long

Sub Sample_HypGetAncestor
   Dim X as Long
   Dim vtAncestor as Variant
   X = HypGetAncestor (Empty, "100-20", "Level", 1, vtAncestor)
End Sub