Skip to Content

how to Enable aggregation sums in smart table

Jul 29, 2017 at 09:39 AM


avatar image

Hi Experts,

i am new to ui5 and working with the smart table type analytical table, and i want to enable the aggregation sum for a particular column, and also want to enable the average for a particular column when we do group by, any suggestions or reference would be great help

Thanks in adavnace,


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sharath M G Jul 29, 2017 at 07:29 PM

Little confused: Do you want to do a group by OR enable sum/average of entries in a particular column.



10 |10000 characters needed characters left characters exceeded
Pradeep V
Jul 30, 2017 at 10:38 AM

Hi Sharath,

Thank you for your response, :)

I have some certain number of Columns, i will take 4 of them as example,


When i do group by EVT_DATE or VEHICLEID,i should be able to see average speed on MAXSPEED, and and sum of TRIPCOUNT, for each group.

i was using smarttable with the tableType responsiveTable, now i want to use Analytical Table.

my code snippet as follows:" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m" xmlns:l="sap.ui.layout" xmlns:fb="sap.ui.comp.filterbar" width="100%">



<Page id="page" title="{i18n>title}">


<smartTable:SmartTable id="smartTableId" useExportToExcel="true" tableType="ResponsiveTable" useVariantManagement="true" useTablePersonalisation="true" showTablePersonalisation="true" header="Line Items" showRowCount="true" persistencyKey="vehicleDetails.smartTable" enableAutoBinding="true" beforeRebindTable="onBeforeRebindTableExtension" requestAtLeastFields="VIN">


<FlexItemData growFactor="1" baseSize="0%">

</FlexItemData> </smartTable:layoutData>

<core:ExtensionPoint name="VehicleTableExtension">

<Table growing="true" id="viewVehicleDetailsId" growingScrollToLoad="true">





<Button icon="sap-icon://download" press="onDataExport"/>




<Column hAlign="Left">


<core:CustomData key="p13nData" value='\{"columnKey": "EVT_DATE","leadingProperty": "EVT_DATE","sortProperty": "EVT_DATE","filterProperty": "EVT_DATE"}'/>


<Text text="{i18n>table_Date}"/>


<Column hAlign="Left">

<customData> <core:CustomData key="p13nData" value='\{"columnKey": "VEHICLEID","leadingProperty": "VEHICLEID","sortProperty": "VEHICLEID","filterProperty": "VEHICLEID"}'/> </customData> <Text text="{i18n>tableVehicleNameColumnTitle}"/>


<Column hAlign="Left"> <customData> <core:CustomData key="p13nData" value='\{"columnKey": "VEHICLE_TYPE","leadingProperty": "MAXSPEED","sortProperty": "MAXSPEED","filterProperty": "MAXSPEED"}'/> </customData> <Text text="{i18n>tableVehicleVehicleType}"/> </Column>

<Column hAlign="Left"> <customData> <core:CustomData key="p13nData" value='\{"columnKey": "TRIPCOUNT","leadingProperty": "TRIPCOUNT","sortProperty": "TRIPCOUNT","filterProperty": "TRIPCOUNT"}'/> </customData> <Text text="{i18n>tableVillageTrips}"/>




<ColumnListItem type="Navigation" press="onLinePress" id="columnListID">


<Text text="{path : 'EVT_DATE', type : 'sap.ui.model.type.Date',formatOptions: { style : 'medium'}}"/>

<Text text="{parts:[{path: 'VEHICLEID'}, {path: 'VEHICLEID'}], formatter: '.formatter.displayFirstOrSecond'}"/>

<Text text="{path :'MAXSPEED'}"/>

<Text text="{path : 'TRIPCOUNT'}"/>

</cells> </ColumnListItem> </items> </Table> </core:ExtensionPoint> </smartTable:SmartTable> </content> </Page> </pages> </App> </mvc:View>

10 |10000 characters needed characters left characters exceeded