Date Filter for loading Excel File

I am trying to filter an excel file from a folder based on date to load onto a database. I have successfully managed to get the filter snap to filter out all months other than current month with the filter code as below,

Date.parse($[‘Update date’]).getMonth()==Date.now().getMonth()

The problem now is i have multiple files for the current month and would like to filter out further to the max of the dates and hence get only one file everytime (currently the above code gets me 2 or more based on current months files).

Thanks for you help.

@Sgarim4

Can you provide the input and expected output ?

Hi Anil,

The input is from a filter snap with the above mentioned filter expression. This returns 2 files, for example one with 07/02/2019 date and another with 07/23/2019. The expected result from this filter snap here should be the file with the time stamp 07/23/2019 as that is the file with latest timestamp.

Essentially, i am reading a directory folder where excel data files are added every month, and i am wanting to build a pipeline to read the latest file and drop the data after some manipulations onto the database.

Regards,
Santosh

Hi @Sgarim4

Please find the attached pipeline. which might help you.

pickLastDateValue_2019_07_24.slp (7.1 KB)

Regards,
Anil

2 Likes

Thanks Anil, This was what I was looking for.

1 Like