Forum Discussion

gsfeliu's avatar
gsfeliu
Contributor II
29 days ago

CellStatus retrieves a different status than shown in the Cube View

Hi all,

I'm trying to build a CV with Entities on rows and Scenarios on columns that will show the status of the cell with the help of a Dynamic Calc.

Here's the aspect of the CV (Scenario and UD8 on columns):

TEST is my dynamic calc (also crossed with V#Annotation so it can display text). As you can see, I can write on U8#None and yet the dynamic calc returns READ.

Here's my code:

Dim sEntName As String = api.Pov.Entity.Name
Dim sScnName As String = api.Pov.Scenario.Name
Dim sStatus As String = Api.Data.GetDataCell("Cb#CORP:E#" & sEntName & ":C#Local:S#" & sScnName & ":T#2018M1:V#YTD:A#ADDUG:F#None:O#Forms:I#None:U1#None:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None").CellStatus.ToString

brapi.ErrorLog.LogMessage(si,"sStatus = " & sEntName & " - " & sScnName & " - " & sStatus)

If sStatus.XFContainsIgnoreCase("WriteAccess: False") Then
	Return "READ"
Else
	Return "WRITE"
End If

Here's the POV of the first cell (on E#3002:S#Actual):

Cb#CORP:E#3002G0:P#?:C#Local:S#Actual:T#2018M1:V#YTD:A#ADDUG:F#None:O#Forms:I#None:U1#None:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None

And this is the Cell Status shown in the CV:

However, the CellStatus that I'm retriving with my Dynamic Calc says the following (I highlight the incongruences in RED😞

Description: sStatus = 3002G0 - Actual - StoredBits: 33, DerivedBits: 264, ExistenceType=IsRealData, StorageType=Input, NoDataZeroViewOverride: Default, Invalid: False, Error: False, IsDefaultFreq: False, ReadOnly: True, ReadAccess: False, WriteAccess: False, CanCalculateFromGrids: False, IsLocked: False, IsFromCalcScript: True, IsDynamicCalc: False, IsCalcStatus: False

Does anybody have any clues why the CellStatus looks different between the script and the CV?

Thanks,

GSF

 

  • I wonder if you dimed the cell status as a True or False Boolean like this:

    Dim isReadonly = BRApi.Finance.Data.GetDataCellUsingMemberScript(si,"Your YourCube","YourCellPOV").DataCellEx.DataCell.CellStatus.ReadOnly
    
    If Not isReadonly Then
    Whatever you want to do
    End If

    If it would behave differently?

    I am doing something similar and it is working for us.

  • T_Kress's avatar
    T_Kress
    Contributor III

    I wonder if you dimed the cell status as a True or False Boolean like this:

    Dim isReadonly = BRApi.Finance.Data.GetDataCellUsingMemberScript(si,"Your YourCube","YourCellPOV").DataCellEx.DataCell.CellStatus.ReadOnly
    
    If Not isReadonly Then
    Whatever you want to do
    End If

    If it would behave differently?

    I am doing something similar and it is working for us.

    • gsfeliu's avatar
      gsfeliu
      Contributor II

      Thanks Teresa. It worked!

      Interestingly, the approach I was following is basically the same. However, the Api syntax for CellStatus returns a different string from the BRApi one that you proposed (and that I'm now using).

      For the record, here's a comparison:

      Dim sApi = Api.Data.GetDataCellEx(sScript).DataCell.CellStatus.ToString
      Dim sBRApi = BRApi.Finance.Data.GetDataCellUsingMemberScript(si,"CORP",sScript).DataCellEx.DataCell.CellStatus.ToString
      
      '*** RESULTS ***
      '  Api = StoredBits: 0, DerivedBits: 264,    ExistenceType=NoData, StorageType=NotStored, NoDataZeroViewOverride: Default, Invalid: False, Error: False, IsDefaultFreq: False, ReadOnly: True,  ReadAccess: False, WriteAccess: False, CanCalculateFromGrids: False, IsLocked: False, IsFromCalcScript: True,  IsDynamicCalc: False, IsCalcStatus: False
      'BRApi = StoredBits: 0, DerivedBits: 262196, ExistenceType=NoData, StorageType=NotStored, NoDataZeroViewOverride: Default, Invalid: False, Error: False, IsDefaultFreq: True,  ReadOnly: False, ReadAccess: True,  WriteAccess: True,  CanCalculateFromGrids: False, IsLocked: False, IsFromCalcScript: False, IsDynamicCalc: False, IsCalcStatus: False

      Also, note the difference in DerivedBits. I wonder what the Api is looking at.

      Kind regards,

      GSF