on 03-28-2023 10:05 PM
Hi community,
I am trying to create a list report app with analytical table based on CAP OData V4 service (UI5 version: 1.109.0). My sample app is located in the Git repository below.
https://github.com/miyasuta/cap-analytical-table
I have referenced to the SAPUI5 SDK document (section "How to Annotate Your Service as an Analytical Service).
I have annotated my entity as below.
namespace my.bookshop;
entity Books {
key ID : Integer @title: 'ID';
title : String @title: 'Title';
category: String @title: 'Category';
stock : Integer @title: 'Stock';
unit: String @title: 'Unit of Measure'
}
@Aggregation.CustomAggregate#stock : 'Edm.Decimal'
@Aggregation.ApplySupported: {
GroupableProperties: [ID, title, category],
Transformations: [
'aggregate',
'topcount',
'bottomcount',
'identity',
'concat',
'groupby',
'filter',
'expand',
'top',
'skip',
'orderby',
'search'
]
}
entity BooksAggregate as projection on Books {
ID,
title,
category,
@Analytics.Measure : true
@Aggregation.default: #SUM
stock,
unit
}<br>
There are two issues now.
1. The measure field (stock) is empty on the list report.
$batch request is successful, but it doesn't seem to fetch quantity.
GET BooksAggregate?$count=true&$apply=groupby((ID,category,title))&$skip=0&$top=62 HTTP/1.1
2. If I try to apply grouping in the table setting, an error occurs.
Below is the query sent when grouping is applied.
GET BooksAggregate?$apply=concat(groupby((ID,category,title))/aggregate($count%20as%20UI5__leaves),groupby((category))/concat(aggregate($count%20as%20UI5__count),top(72))) HTTP/1.1
What is the minimum requirement to make analytical table work?
Update (2023/3/29) ------------------------------------------------------------------------------------
The second issue was resolved when I added the following code to package.json.
"cds": {
"features": {
"odata_new_parser": true
}
}
"concat" feature is supported with experimental feature as described in the document.
Now it looks like below, but stock value is still missing.
----------------------------------------------------------------------------------------------------------------
Best regards,
Mio
With @Aggregation.ApplySupported annotation only, the measure field is now displayed.
@Aggregation.ApplySupported
entity BooksAggregate as projection on Books {
ID,
title,
category,
@Analytics.Measure : true
@Aggregation.default: #SUM
stock,
unit
}
But unfortunately, the totals line as we saw in v2 list report is not displayed. This holds true even after I apply grouping. Stock is not aggregated based on the grouping criteria.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mio,
I have followed your blogs and tried to display total value.
But total value for integer property not showing in table. if i check in network $batch call is not happening for total, for groupby it is working fine.
I have added PresentationVariant and below code also
"features": {
"odata_new_parser": true
}
My ui5 application version is 1.108.0
kindly help on this issue.
Thanks,
Preethi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.