Tuesday, April 26, 2016

Smart View Custom Excel Formulas - Gen or Level

Have you ever wanted to know what the generation or level of a particular member is with ease? Quickly? On the fly? From Excel even? Without a refresh?

Use the Smart View VB toolkit and "retrieve" the generation or level of a particular member or members with an Excel Function!


*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Generation Formula:

Public Function GetGeneration(strDimension As Range) As String
Attribute GetGeneration.VB_Description = ":: This function ""=GetGeneration(cell)"" allows you to reference a cell which IS A VALID MEMBER of the outline and returns the GENERATION NUMBER of that member ::"""
         
    Dim strDimG As String
    strDimG = CStr(strDimension.Value)
    If strDimension <> "" Then
   
X = HypFindMember(Empty, strDimG, "Default", dimName, aliasName, GenName, levelName)

    GetGeneration = (GenName)

    End If
    
End Function

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Level Formula:  
Public Function GetLevel(strDimension As Range) As String
Attribute GetLevel.VB_Description = ":: This function ""=GetLevel(cell)"" allows you to reference a cell which IS A VALID MEMBER of the outline and returns the LEVEL NUMBER of that member ::"""
         
    Dim strDimG As String
    strDimG = CStr(strDimension.Value)
    If strDimension <> "" Then
   
X = HypFindMember(Empty, strDimG, "Default", dimName, aliasName, GenName, levelName)

    GetLevel = (levelName)

    End If
    
End Function
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


No comments:

Post a Comment