Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get the Day and week based on the date

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.

0683p000009M4cr.jpg

I have tried multiple things but have had no luck. Will appreciate any help received to resolve this issue.

 

Thanks

SK

Labels (2)
5 Replies
akumar2301
Specialist II
Specialist II

It is little confusing.

Do you want to split file for each week?
Anonymous
Not applicable
Author

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

akumar2301
Specialist II
Specialist II

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/

Anonymous
Not applicable
Author

Should I add this in tmap ? How do I filter the values ?

akumar2301
Specialist II
Specialist II

Yes 1st create additional column weknumber in tMap with Above expression and then follow the link from tFlowToIterator.