Oracle EPM Planning:- Extract data using groovy

Hi All, How are you? I hope you must be enjoying the monsoon specially if you are in India that too nearby some hill station. I was working with one of the admin user where they wanted to extract planning data for their analysis. They had 2 requirements:-

1. To extract data in file
2. If they wanted to filter some of the data

In order to solve the concern of the user and to showcase some demo i took the help of groovy. Below code will solve the issue of 1st requirement-

Cube cube = operation.application.getCube("OEP_FS")
cube.createDataExporter().setDateFormat("dd/MM/yyyy")
.setDelimiter('|')
.setColumnMemberNames(["Jan", "Feb", "Mar"])
.setRowFilterCriteria("Smart Phone 4 in","OEP_Forecast","FY23","OFS_Load","Product Revenue")
.setDataExportFormat(CELL_FORMAT)
.setErrorFileName("ExportError.log")
.exportDataToFile("SalesUS.csv")

The above code is an example and can download data in csv format for 3 month.
Now next point where user wanted to extract file with some filter. E.g.:- any data above 10K in Jan i wanted to extract. Below groovy script can sort out this issue :-

Cube cube = operation.application.getCube("OEP_FS")
cube.createDataExporter().setDateFormat("dd/MM/yyyy")
.setDelimiter('|')
.setColumnMemberNames(["Jan", "Feb", "Mar"])
.setRowFilterCriteria({RowData row -> Double.parseDouble(row.getValue("Jan")) > 10000})
.setDataExportFormat(CELL_FORMAT)
.setErrorFileName("ExportError.log")
.exportDataToFile("SalesUS.csv")

This will again be extracted in the csv file.

 I hope this was helpful. 

                                                                     !!!Happy Reading!!!

Comments

Popular posts from this blog

Oracle EPM Planning - Planning, Budgeting, Forecasting, and Long-Range Planning

Oracle EPM Planning Account Dimension: Complete Guide to Member Properties with Examples

Creating your first EPM Application