cancel
Showing results for 
Search instead for 
Did you mean: 

fiori elements : List Report aggregate function

former_member729305
Participant
1,910

Dear Community,

in CAP Fiori Elements List Report we have the requirement to show a line at the buttom that sums up all values of a column (in this example stock) like a total amount. Do you know if this is feasible and if so how would it be implemented?

the first approach was to realize this with the @Aggregation annotation and a presentation Variant as shown below:

schema.cds

@Aggregation.ApplySupported.PropertyRestrictions : true
view Product_View as
    select from Product {
        key productId,
            //@Analytics.Dimension: true
            productName,
            //@Analytics.Dimension: true
            productCategory,
            //@Analytics.Dimension: true
            productGroupId,
          
            @Analytics.Measure   : true
            @Aggregation.default : #SUM
            stock,
            currency_code,
            currency
    };

annotations:

PresentationVariant #general_tab_Presentation : {
        $Type          : 'UI.PresentationVariantType',
        Text           : 'General',

        RequestAtLeast : [
            productName,productCategory, stock
        ],  
        SortOrder      : [{
            $Type    : 'Common.SortOrderType',
            Property : productId,
            Descending : true
        }],
        
        // GroupBy : [
        //     productCategory
        // ],
       
        // TotalBy: [
        //     productCategory
        // ],  
      
        // Total : [
        //     stock
        // ],
        Visualizations : ['@UI.LineItem#lineItem_general'],
    },

As soon as I use the groupBy functionality within my Presentation Variant I receive the following erro:

Has anybody experienced the same error respectively know how a potential solution looks like?

Best Regards

Tobias5
Discoverer
0 Kudos
Hello,
inesmartins
Participant
0 Kudos
Did you solve it? How? Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

MioYasutake
Active Contributor
0 Kudos

@inesmartins 

For the "feature is not supported error", please add the following configuration to package.json.

  "cds": {
    "features": {
      "odata_new_parser": true
    }
  }

I have written the following blog post on this topic.

https://community.sap.com/t5/technology-blogs-by-members/fiori-elements-analytical-table-with-cap-do...