Forum Discussion

Sean's avatar
Sean
New Contributor
3 years ago

How to bring attribute "Text" fields value into a Cube View

Hello,

I would like to bring attribute "Text 1" field identified in Entity dimension into a Cube view. 

When users run a Cube View, they should be able to see Entity as a Column name and the “Text 1” field attribute which is identified in entity

  • EricOsmanski's avatar
    EricOsmanski
    Valued Contributor

    Hi Sean - you will be able to do this with a Dynamic Calc. See below for screenshots of the setup. On your CV column, you would reference this member with one of the annotation View members, such as U8#Ent_Text1:V#Annotation.

    Dim entity As String = api.Pov.entity.Name
    Dim entityId As Integer = api.Pov.entity.MemberId
    Dim entityText1 As String = api.entity.Text(entityId,1).ToString

    Return entityText1

     

     

    • Sean's avatar
      Sean
      New Contributor

      Hi Eric,

      Thank you very much!! It is working exactly the way I need after following all your steps.  Really appreciate taking your time and effort to answer my question.

      Best Regards,

      Sean

      Sean

    • salmankhanani's avatar
      salmankhanani
      New Contributor II

      Hi Eric - can you explain how this can be altered to pull the Text 1 - Text 8 fields from the account dimension rather than entity?

      Thanks!

      • EricOsmanski's avatar
        EricOsmanski
        Valued Contributor

        Hello - you should just be able to change the code to reference Account (or another dimension) as well as the particular text field you are looking to retrieve:

        Dim acct As String = api.Pov.Account.Name
        Dim acctId As Integer = api.Pov.Account.MemberId
        Dim acctText1 As String = api.Account.Text(acctId,1)

        Return acctText1