Skip to Main Content

Analytics Software

Ghost "BaseData" in Groovy BR

M_SladicMay 14 2019 — edited Jul 12 2019

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

"""

Comments