Aggregation Function and Data Visualizations
Application Builder Cloud Service (ABCS) has introduced important features in its latest versions like giving the user the ability to add chart and gauge component to a page and to add field for aggregating data in a Business Object.
This blog will show the user how to create a quick application where a gourmet store is using aggregation function and charts functionality to analyze the sales data of its products for forecasting purposes.
Charts provide technical and fundamental analysis of data trends which helps business users or analysts make informed decisions in regards to the business strategies to be followed for future growth. For example by studying the product market trends through charts one can understand the supply and demand scenarios and modify pricing for the products. ABCS provides the users to drag and drop various chart components to a page and equipped for analysis within minutes.
Field for aggregated data in a Business Object
With aggregation the business user can add a field in a business object to show aggregate data in a related or child object. If there were business objects for Products (Figure 1) and Orders (Figure 2) then the user can aggregate data for total quantity sold for each product using the data from orders business object.
Figure 1: Products BO
In addition to the following fields OrderID(Number), Quantity(Number), OrderDate(Date) “Orders” Business Object(BO) has two additional fields. ProductName is a reference to the field of the same name in “Products” and another field named as Status which is a lookup type object with values “Completed” and “Pending”.
Figure 2: Orders BO
The creation of reference field also associated the Orders BO with the Products BO and makes it a related Business Object (Figure 3). This relationship is important for the aggregation to function.
Also, note the Figure 2 shows the lookup Object “Status” we created for the look up values.
Figure 3: Related Objects for Orders BO
We have populated the Products Object with sample data as shown in the figure (Figure 4). Each of the products in this object has an id automatically associated with it.
Figure 4: Sample Data in Products BO
Now add a few data points to the Orders business object as well. Create new rows for data (Figure 5)
Figure 5: Adding new data row in Orders BO
The sample data would look like the figure shown (Figure 6). The ProductName field has an id that corresponds to the id of the product in the Product BO
Figure 6: Sample Data in Orders BO
To calculate how many units of the products were sold we will leverage the aggregation function and aggregate the data from the Orders BO and show it in a field in Products BO.
In the Data Manager navigate to Products BO and add a field of Number data type and name it “TotalSold” (Figure 7)
Figure 7: Add field for aggregation in Products BO
Edit the field “TotalSold” in the fields tab and create a new aggregation. (Figure 8)
Figure 8: Edit Aggregation field to add a new aggregation rule
Object to Aggregate dropdown would be automatically configured. The aggregation rule used here is Total of the “Quantities” field in Orders BO. (Figure 9)
Figure 9: Aggregate over Quantity field in Orders BO
Navigate to the Products BO data tab to check the aggregated data in the “TotalSold” field. (Figure 10)
Figure 10: Aggregation Results
Creating Charts using Aggregated Data
We can now create charts on this data and use them in further price point analysis. Drag and drop a pie chart to a details page (Figure 11). Change the Chart slices to Percent
Figure 11: Add pie Chart component on a create/details page
We can add another chart to the same page which shows products to unit price analysis. Drag and drop a bar chart component to the same page (Figure 12)
Figure 12: Add Bar chart component to the same page
Now a business analyst can analyze the total sales percentage in correlation to the unit prices. For example it’s easily noticeable how the most expensive product is still one of the most sold ones as well. Further intricate comparison with sales data of different months can give more detailed insights on the market. (Figure 13)
Figure 13: Charts for forecast analysis
More info on Application Builder Cloud Service: https://cloud.oracle.com/ApplicationBuilder
Application Builder Cloud Service Channel: https://www.youtube.com/channel/UCFMTiIZAE6f3Ib91sY6Ms3g