A cube can be created by using attributes and so retrieving data from the database as explained in: Create a new cube
However, in many scenarios, more flexibility is needed in order to create a cube by integrating data from different sources (web services, APIs, other databases, etc.)
For example, we are going to create a cube to analyze the information regarding the sales of the company. The information is generated in another application and exposed as a web service, so we can't create a standard cube from a database table.
An SDT to store the data is created as follows:
And a Data Provider, called DPSales, is developed to load the data from the web service.
To create a cube, you should go to WorkWithPlus-->for BI-->Manage Cubes and define the required connect data:
Then, in step 2, select the "SDTSales" and define the desired SDT's attributes to be used in the cube's structure:
In step 3, you should confirm the cube and finally, WorkWithPlus for BI will perform the following tasks:
- create the cube's structure according to the desired configuration
- create a procedure to generate a CSV by using the SDT's data
- import the necessary web panels to run the cube and query it
Instead of retrieving the data from a table, the data is
You should customize the sub 'LoadSDTData' in order to load the &DataCollection variable with the desired data. In our example, we are going to call the Data Provider "DPSales" but you can call a procedure or load the variable straightforward inside the sub.
Sub 'LoadSDT'
/* Add the code to load the SDT - For example: &DataCollection=DPLoadData()*/
&DataCollection=DPSales()
EndSub
Customize the procedure "BusinessIntelligencePlusUploadData" in order to load your data to the cube.
//1 - Uncomment the code below and copy the data from the BusinessIntelligencePlus<NAME_CUBE>Data procedure
&ds=1571
&dsload=1379
&username="testuser@dvelop.com.uy"
&password="******"
&server="https://services.bip.dvelopsoftware.com/"
&proxyip=""
&proxyport=""
&cubename="Sales"
//2 - Remove the current cube's data by using the EmptyCube or RemoveData methods
&isRemoved=UtilsBusinessIntelligencePlus.EmptyCube(&server,&username,&password,&proxyip,&proxyport,&dsload)
//3 - Generate the CSV file
Call(BusinessIntelligencePlusCSVSales)
//4 - Upload the CSV file to load the cube
&isOK=UtilsBusinessIntelligencePlus.UploadData(&server,&username,&password,&proxyip,&proxyport,'',&cubename,&dsload)
//5 - Run the procedure by doing right click --> Run
//If you want to run this procedure by command line, follow the instructions below:
In Updating data you learn further information about this step.
We're ready! Run the "WPCube" web panel in order to run your cube and query it.
|