Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have an excel sheet with 2 weeks data in it. There is a date column (dd/MM/yyyy format) in it and I need to filter the values based on the date. The week I would need is Sunday - Saturday. E.g., I have the data as below:
| <DATEIN> |
| 03-02-2019 |
| 04-02-2019 |
| 05-02-2019 |
| 06-02-2019 |
| 07-02-2019 |
| 08-02-2019 |
| 09-02-2019 |
| 11-02-2019 |
| 12-02-2019 |
| 13-02-2019 |
| 14-02-2019 |
| 15-02-2019 |
| 16-02-2019 |
Now if we look up the calendar, we can see that 03/02/2019 is a Sunday and I need the entire weeks data i.e., 03/02/2019 - 09/02/2019.
And then I need a different filter that will pick the second week's data which starts again on Sunday which should be 10/02/2019. But my excel does not have data for 10/02/2019, so it should pick data from 11/02/2019 - 16/02/2019. I am attaching the file for reference. I will be getting multiple files with different dates and the filter should work as the above logic.
I have tried multiple things but have had no luck. Will appreciate any help received to resolve this issue.
Thanks
SK
Hi Abhishek,
Yes I want to split the data into 2 weeks but the week we would considering would be Sunday - Saturday.
I have posted example data.
Thanks
SK
you do not need lookup for this
TalendDate.getPartOfDate("WEEK_OF_YEAR", TalendDate.parseDate("ddMMyyyy",DATEIN))
will give you weeknumber.Now you just would need to split your based on this value.
http://talendhowto.com/2017/10/27/how-to-split-file-depending-on-column-values-2/
Should I add this in tmap ? How do I filter the values ?
Yes 1st create additional column weknumber in tMap with Above expression and then follow the link from tFlowToIterator.