How do we show Totals and Subtotals in SAPUI5 analytical table

83 Views Asked by At

In smart table I want to show both totals and subtotals for hours column. I have created smart table with tableType = "AnalyticalTable" and in the backend we have created sap:semantics="aggregate" for EntitySet and sap:aggregation-role="measure" for hours column and sap:aggregation-role="dimension" for other properties for grouping. I tried using summed = true for Analytical column but not able to show totals. Also, I have tried Total/TotalBy annotations. But they also didn't work.

<Annotations Target="Metadata.Cats_Da/">
     <Annotation Term="UI.PresentationVariant">
            <Record Type="UI.PresentationVariantType">
                <PropertyValue Property="Total">
                  <Collection>
                    <PropertyPath>Hours</PropertyPath>
                  </Collection>
                </PropertyValue>    
           </Record>
            </Annotation>
</Annotations>

In Header item menu 'Total' is showing but not able to aggregate. It's displaying as below. We would like to perform totals and subtotals.

enter image description here

Could you please provide suggestions? I am not sure what we are missing.

0

There are 0 best solutions below