Oracle EPM Data Copy: Hybrid BSO Parent Member to Temp Store Member for Faster Calculation
I wanted to bring up an issue that we have been encountering in our Oracle EPM Hybrid BSO world, specifically related to calculation performance.
As a functional team, we have noticed that certain combinations that need to be referred in the calculation are appearing at the parent member level. Due to this, the calculation process is taking a significant amount of time.
In our previous linkedin post, I touched upon the idea of enhancing the functionality of calculation by performing a data copy process of the Hybrid BSO Parent Member to the Temp Store Member. This approach has the potential to significantly improve the speed of calculations in Oracle EPM.
This process can be particularly useful in situations like P&L element needs to be referred in Balance sheet or any other scenario I just mentioned one example.
I hope you will like this post and also suggest if you have any other alternative.
/*RTPS: */
/************************************************************************************/
/* Use groovy to copy dynamic members to stored members
/***********************************************************************************/
Application app = operation.application
Cube cube = app.getCube("CubeName")
/************************************************************************************/
/* Step 1: This section creates a grid with the dynamic members
/***********************************************************************************/
DataGridDefinitionBuilder sourceBuilder = cube.dataGridDefinitionBuilder()
sourceBuilder.setSuppressMissingRowsNative(true)
sourceBuilder.addPov([ 'Location', 'Intercompany', 'Particulars', 'Scenario' ],
[ ['No Location'], ['No Intercompany'], ['No Particulars'],["&Scenario"] ] )
sourceBuilder.addColumn(['Years'], [ ["&BudYr"] ])
sourceBuilder.addRow([ 'Period' ,'Entity', 'Account', 'Responsibility Center', 'Line Item', 'Version', 'Plan Element', 'Future Use', 'Project', 'Client','Line of Business', 'Currency'],
[
['ILvl0Descendants("YearTotal")'],
['ILvl0Descendants("Total Entity")'],
['400000AC','500000AC'],
['ILvl0Descendants("All Cost Center")'],
['Default Line-Direct','Default Line-Indirect'],
["Total"],['Total Plan'],['All Future Use'],['All Project'],
['All Clients'], ['All LOB'],
['ILvl0Descendants("Input Currencies")']
])
DataGridDefinition sourceGridDef = sourceBuilder.build()
def targetRows = []
/************************************************************************************/
/* Step 2: This step applies the mapping of dynamic mem to store mem */
/**********************************************************************************/
cube.loadGrid(sourceGridDef, false).withCloseable { sourceGrid ->
Map mappings = [
/* Copy dynamic member to store member for auto predict */
'400000AC' : '400000AC.',
'500000AC' : '500000AC.',
'Total' : 'Total_Version',
'Total Plan' : 'Pre-Allocation',
'All Future Use' : 'FU_Total',
'All Project' : 'PJ_Total',
'All Clients' : 'CL_Total',
'All LOB' : 'LB_Total',
'All Cost Center' : 'CC_Total'
]
sourceGrid.rows.each { row ->
List<String> rowHeaders = row.headers.collect{mappings.containsKey(it.mbrName) ? mappings[it.mbrName] : it.mbrName}
def rowData = []
rowData = row.data.collect{it.missing ? '#Missing' : it.data}
targetRows << [rowHeaders, rowData]
}
}
/*******************************************************************/
/* Step 3: This step creates the grid where the data will be copied to and copies the data. Just Note Only one dimension can be referred in Target Grid Column
/*******************************************************************************/
/* If the source grid (targetRows) contains data, continue, else go to the end of the rule without error */
if(targetRows){
DataGridBuilder targetGrid = cube.dataGridBuilder("MM/DD/YYYY")
targetGrid.addPov( 'No Location', 'No Intercompany', 'No Particulars',"&Scenario" )
targetGrid.addColumn ("&BudYr" )
targetRows.each { row ->
List listRow = (List) row
targetGrid.addRow((List< String>) listRow[0] , (List<>) listRow[1])
}
DataGridBuilder.Status status = new DataGridBuilder.Status()
targetGrid.build(status).withCloseable { grid ->
println("Total number of cells accepted: $status.numAcceptedCells")
println("Total number of cells rejected: $status.numRejectedCells")
println("First 100 rejected cells: $status.cellsRejected")
// Save the data to the cube
cube.saveGrid(grid)
}
}
Comments
Post a Comment