Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Odata aggregation with Header/Item calculation views

andrefernandes
Participant
0 Likes
1,295

Hi everyone,

We are developing Multi-Target Applications (MTAs) in WebIDE FullStack to be deployed in the Cloud Foundry environment. Those MTAs have a DB module with calculation views(CVs), A Node.JS module to expose those calculation views as odata services and HTML5 modules for UI5 apps using the Fiori Elements templates.

We have CVs for Header and Item data, and those data are exposed as different Entity types on the odata, with a navigation property linking them.

Header (Product table - Shows the different products on an invoice)
  • Invoice Id
  • Product Id
  • Description
  • Cost
  • Weight

Item (Charges table - Shows the different charges applied to the product)

  • Invoice Id
  • Product Id
  • Charge Id
  • Charged Amount

The problem is that the client is requiring to see both Header and Item data on the same Analytical Page. We made it work by creating a single CV combining both data.

Combined

  • Invoice Id
  • Product Id
  • Charge Id
  • H-Description
  • H-Cost
  • H-Weight
  • I-Charged Amount

However I am currently struggling with the aggregation. Because the relation between Header and Item is 1:n, Cost and Weight will be duplicated for every Item entry on a particular Header. Therefore, when I make the aggregation of the whole thing, their values will be way higher than they should.

So my question is: is there a way for making the calculation view recognise the hierarchy levels between data sources and keep them from aggregating in such cases? I know when you create a Counter on the CV, you can set which properties to take into account. Is there a similar feature for other Measure properties?

Best regards,

André

3 REPLIES 3
Read only

andrefernandes
Participant
0 Likes
1,179

Hey kevin.bates, could anyone on your team shed some light here?

Read only

Kevin_SAP
Product and Topic Expert
Product and Topic Expert
1,179

Andre,

I actually don't support MTAs or Cloud Foundry, but have asked some developers who helped with the last question if they could take a look.

-kevin

Read only

Kevin_SAP
Product and Topic Expert
Product and Topic Expert
1,179

Talked with the Cloud Foundry developers. This is more to do with oData and not Cloud Foundry or MTA. You may want to query the SAPUI5 or oData folks.

-kevin