This recipe shows how to filter records using the current date.
Steps taken:
- Create a composite datasource (cmps-FilterByToday.ds). Drag and drop the tabular datasource (Employee.ds) as the beginning of the flow.
- Add a “Derivative” element following the tabular datasource. Make the following settings in “Derivative > Derived” tab:Column Name=DateCompare, Type=Integer, Value=elxfn.dateDiff(birth_date,new java.util.Date(),‘d’)
- Add a “Filter” element following the “Derivative”. Make the following settings in “Filter > Filter #1” tab page:Column Name=DateCompare, Type=Integer, When=Equals, Condition=0
To download the necessary files for this recipe, refer to the attached ZIP package.
FilterByCurrentDate.zip