Forum Discussion

Sridhar_M's avatar
Sridhar_M
Contributor
4 months ago

Is it possible to return a string with CubeView GetDataCell Function

Hi everyone,

We have a cube view with three rows structured as follows:

Row1: E#Parent1.Children:U1#Member1

Row2: E#Parent1.Children:U1#Member2

Row3: Variance between two columns.

To handle this, I created an XFBR that dynamically generates a string based on the number of children for the user-selected parent (Parent1 as a parameter). The generated string will look something like this:

GetDataCell(CVR(Row1,1) - CVR(Row2,1)), GetDataCell(CVR(Row1,2) - CVR(Row2,2)), and so on.

We have three columns in the same cube view: two data columns and one text column. The text column uses the U8 member as a dynamic calc member, which returns a string.

In the variance row for the text column, I'm getting a blank instead of a string. I’ve tried different row override methods using XFBR and XFCell, but haven’t had any success. I suspect that GetDataCell might be causing the issue, but I wanted to ask for some guidance. Has anyone encountered this problem, or does anyone have any suggestions? Your input would be greatly appreciated.

Regards

Sridhar 

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    The real issue here is that your UD8 is returning a string and you think it should be a number. If it's supposed to be a number it should return a number. You can't subtract strings.

    • Sridhar_M's avatar
      Sridhar_M
      Contributor

      Hi JackLacava 

      Thank you for your response. Yes, I need to return a string, which is why I'm using row overrides to avoid passing the GetDataCell function that's being fetched from the XFBR.

  • TheJonG's avatar
    TheJonG
    Contributor III

    Hi there - a screenshot of the Cube View may be helpful to get a clear picture of what you are trying to do but my first thought is that when you are trying to show text in a Cube View cell you need to use one of the View members that allows text e.g. Annotation, Assumptions, Footnote, etc. 

    • Sridhar_M's avatar
      Sridhar_M
      Contributor

      Hi TheJonG 

      Thank you for the feedback. Below is a sample export of the cube view, and yes, I'm using V#Annotation to retrieve the string. The sections highlighted in green should display the same Entity Groups as in Actual and Forecast.

      • TheJonG's avatar
        TheJonG
        Contributor III

        Not totally sure but I do think the GetDataCell is messing it up. Instead of using a GetDataCell with the CVR functions you could use a UD8 dynamic calc instead and replicate the logic there. Then you can do an If Statement on one the POV members of the third column and have it return the text for that column only. If this isn't clear, paste in a screenshot of the third column member filter and I can try to give you an example script.