Showing results for 
Search instead for 
Did you mean: 

Separate OData into two tables based on a criterial

0 Kudos


I wanted to separate oData coming from 1 entity set into two tables. The Active table would need to show only the ones with the end date of 20180312 and the Future table would show the rest.

I was trying to use the Filter and Filter operator but it still shows all the entries.

Currently I bind it like this:

var activeTemplate = new sap.m.ColumnListItem({
	cells: [
		new sap.m.Text({
				text: "{USER_ID}"
		new sap.m.Text({
		new sap.m.Text({
				text: "{START_DATE} - {END_DATE}"
var date = "20180312";
var oFilterActive = new Filter("END_DATE", FilterOperator.EQ, date);
	path: "/ITS_OQASet",
	filter: oFilterActive,
	template: activeTemplate});
var date1 = "20180530";
var oFilterFuture = new Filter("END_DATE", FilterOperator.EQ, date1);
	path: "/ITS_OQASet",
	filter: oFilterFuture,
	template: activeTemplate});


Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Elena,

Have you implemented filter option in backend yet?



0 Kudos

Thanks Tri Minh Le,

I did end up adding the filter on the xml side like this:

<Table id="activeTable" width="auto" class="sapUiResponsiveMargin activeTable" items="{path: '/ITS_OQASet', sorter: { path: 'START_DATE', descending: false}, filters : [{path: 'USER_ID', operator: 'EQ', value1: ''}]}" noDataText="No Data" busyIndicatorDelay="{worklistView>/tableBusyDelay}" growing="true" growingScrollToLoad="true" headerText="Active" mode="Delete" delete="deleteRowConfirm" updateFinished="onUpdateFinished" backgroundDesign="Solid">

	<Table id="futureTable" width="auto" class="sapUiResponsiveMargin futureTable" noDataText="No Data" headerText="Future" items="{path: '/ITS_OQASet', sorter: { path: 'START_DATE', descending: false}, filters : [{path: 'FUTURE', operator: 'EQ', value1: 'X'}]}" growing="true" growingScrollToLoad="true" mode="Delete" delete="deleteRowConfirm" updateFinished="onUpdateFinished1">

Then I was able to filter in the backend to where it only got the specific ones I wanted based on the date.

Answers (0)