Forum Stats

  • 3,838,625 Users
  • 2,262,385 Discussions
  • 7,900,710 Comments

Discussions

Ghost "BaseData" in Groovy BR

M_Sladic
M_Sladic Member Posts: 18
edited Jul 12, 2019 9:03AM in Planning and Budgeting

Hi all,

I am trying on Groovy Business Rules in EPBCS, and have created a sample script in CM, based on in2Hyperion blog (see the script below). The scripts seems to be working fine up to the point of getting POV - for whatever reason my result string in "sPov" starts with "null","Fy20",... The function doesn't recognize the HSP_VIEW dimension, and instead is giving me "null". What's more confusing, when I delete (manually) that "null", and save the script in CM, the "Script" tab shows "BaseData" as the first member?? Any explanations and what to do to avoid this "BaseData" ghost? Mind you, I want "BaseData" in my FIX statement, but as part of the sPOV.

Here is the full CM script (minus many comments):

DataGrid curgrid = operation.getGrid()

StringBuilder scriptBldr = StringBuilder.newInstance()

StringBuilder editMbrList = StringBuilder.newInstance()

String sMembers

GridIterator itr = curgrid.getDataCellIterator(PredicateUtils.invokerPredicate("isEdited"))

String sPov = '"' + curgrid.getPov().essbaseMbrName.join(',').replaceAll(',','","') + '"'

// this is to get rid of the extra comma at the end

sPov = sPov[0..-1]

//

println "POV: " + sPov

itr.each{ DataCell cell ->

  sMembers = cell.getMemberName("Management")

  if(editMbrList.indexOf(sMembers) < 0){

  if(editMbrList.size() > 1){ // add comma only if more than one members in the list

    editMbrList << """

    ,"$sMembers"

    """

  } else {

    editMbrList << """

    "$sMembers"

    """

    }

  }

}

println "Mbrs: " + editMbrList[0]

scriptBldr <<"""

FIX($sPov,

    $editMbrList,

    "Jul":"Feb",

"FY20")

     "Prediction" = "Input" * 0.9;

  ENDFIX

"""

Tagged:

Answers

  • M_Sladic
    M_Sladic Member Posts: 18
    edited Jul 12, 2019 9:03AM

    Just an update..

    After 2-3 weeks of not trying this script, I tried it yesterday, and now the command:

    String sPov = '"' + curgrid.getPov().essbaseMbrName.join(',').replaceAll(',','","') + '"'

    gets me the full list of POV dimensions, including the "BaseData" in HSP_VIEW. I assume it was a bug that was fixed in the meantime,

    Milos