Forum Discussion

BenEppel's avatar
BenEppel
Contributor
1 month ago

Returning text from a BR# inside GetDataCell — possible?

I'm building a cube view column that shows combined annotations from descendants. I'm calling an Finance Cell Service BR from inside GetDataCell so I can pass dashboard params needed for the logic. 

GetDataCell(T#|CVTime|:BR#[BRName=..., FunctionName=CombinedComment, Flux_ID = {fluxID}]:U8#{ud8}):Name({ud8} Combined). I need to the UD8 POV member because that distinguishes what type of comment it is (CMvsPM, CQvsPQ, CMvsPYM, Ect...).

 

The BR returns a String, but GetDataCell expects a numeric amount so the text doesn't render in the cell. Pointing the column at V#Annotation doesn't help either.

Has anyone gotten BR-returned text to display in a GetDataCell with full POV/param context? 

Thanks,

Ben

1 Reply

  • dsebenaler's avatar
    dsebenaler
    New Contributor III

    You might consider doing this via dynamic calc member instead. There is a 'annotations consolidation' snippet example available to build from. The example is a UD8 member but you could create a dynamic calc member in a different UD dim.

    'Cube View definition
    'Row Definition:  E#[Total GolfStream].tree
    'Col1 Definition:  V#Annotation:Name("Comment")
    'Col2 Definition:  V#Annotation:UD8#DynamicTextCons:Name("Consolidated")
    
    'UD8 Member setup
    'Name:     DynamicTextCons   <-- If this is changed it must be updated in the CV Col2 definition above.
    'Formula Type:   DynamicCalc
    'Allow Input:   True
    'Is Consolidated:  False
    'In Use:    True
    
    'Assign the  formula below to the UD8 member to show the consolidated text
    Dim iEntityID As Integer = api.pov.Entity.MemberId
    Dim iETestID As Integer
    Dim strETestName As String = string.empty
    Dim eTest As Member
    Dim sSave As String = string.empty
    Dim sSource As String = string.empty
    
    If api.View.IsAnnotationType Then
     If api.Entity.HasChildren() Then
    
      For Each etest In api.Members.GetDescendents(api.Dimensions.GetBaseDim(dimtypeid.Entity).DimPk, iEntityID)
       iETestID = etest.MemberId
       sSource = api.Data.GetDataCellEx("U8#None:E#[" & etest.Name & "]:C#" & api.Entity.GetLocalCurrency(iETestID).Name).DataCellAnnotation
     
       If Not sSource.Equals(String.Empty) Then
        sSave = sSave.Trim & "; " & eTest.Name & ": " & sSource
       End If
      Next
     Else
    
      sSource = api.Data.GetDataCellEx("U8#None:E#[" & api.pov.entity.Name & "]").DataCellAnnotation
      If Not sSource.Equals(String.Empty) Then
       sSave = ";" & sSource
      End If
     End If
    End If
    
    If Not sSave.Equals(String.Empty) Then
     Return right(sSave, len(sSave)-1).Trim
    Else
     Return Nothing
    End If