Skip to content

Data Process

Now that the data is held within the file manager, we will create a data process to import it.

From our Model Page, we will create a new process by going to Process and clicking New Process and naming it Profit and Loss FY17 Actual. Double click our new process to go into it.

Process Page

In the Datasource Selection Panel, we will change the datasource in the process to look at the MODLR File System and selecting the we just uploaded, sample profit and loss data final.csv file

Process View

Open the Process Scripting tab by clicking on the dash on the right. In here we will add some lines of code to load the data into our cube.

We only need to add two lines of code

First, we add the below code to the begin function after the script.log (shown in image below).

js
	cube.wipe("Profit and Loss","","","","","","");
	cube.wipe("Profit and Loss","","","","","","");

First, we add the below code to the data function after comments that are in green (shown in image below).

js
	cube.set(record.value, "Profit and Loss", record.years, record.month_value, record.scenario, record.department, record.accounts, "$" )
	cube.set(record.value, "Profit and Loss", record.years, record.month_value, record.scenario, record.department, record.accounts, "$" )

Process code

Then you can scroll down the page Validate and Execute the process. Executing the process will also save it.

Now let's head over to the logs page and check on your process.

Go to the logs page through the top navigation

On the logs page, once we refresh, we can see that the data has been loaded successfully.

Process Logs

We will open our Workview from our model page to see how it looks.

Workview with updated data