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

SAP HANA Calculation Views exposed by CAP

patty_1982
SAP Champion
SAP Champion
0 Kudos
628

Hello guys,

I would like to discuss with you the best approach to using SAP HANA calculation views exposed by a CAP service. I have several tables on the HANA DB that I have joined to get a single table on which to perform my analyses and aggregations. During the aggregation phase to get the measures I need, I used the Hidden property present on the Semantic node to ensure that the columns are not actually present as fields of the table but can be used as conditions in a where clause. For instance:

My initial table:

Name Last NameCompany Office
John SmithCompany 1Office 1
MichaelDoeCompany 2Office 2
SteveJohnCompany 3Office 2
PatriziaRossiCompany 2Office 3

My Calculation View:

CompanyEmployee
Company 11
Company 22
Company 31

If I run a select * from my_calculation_view from the SQL console I get my Calculation view with 2 columns but it is also possible to run select * from my_calculation_view where Office= 'Office 2' to get this result

CompanyEmployee
Company 21
Company 31

So Office column is not visible in my view but it is possible to use it in the where condition at least on the SQL console.

We generated the OData with a CAP service, but the hidden fields are not in the metadata so when we try to apply the $filter=Office eq 'Office2' it doesn't work.

which is the best approach in this case?

 

1 REPLY 1
Read only

patty_1982
SAP Champion
SAP Champion
0 Kudos
590

I tried to use the Transparent filter option but it didn't work. Although the field is set as transparent, it is considered in the aggregation. Could it be a bug in BAS?