cancel
Showing results for 
Search instead for 
Did you mean: 

Date Filter for loading Excel File

Sgarim4
New Contributor II

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.

1 ACCEPTED SOLUTION

Anil
New Contributor III

Hi @Sgarim4

Please find the attached pipeline. which might help you.

pickLastDateValue_2019_07_24.slp (7.1 KB)

Regards,
Anil

View solution in original post

4 REPLIES 4

Anil
New Contributor III

@Sgarim4

Can you provide the input and expected output ?

Sgarim4
New Contributor II

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

Anil
New Contributor III

Hi @Sgarim4

Please find the attached pipeline. which might help you.

pickLastDateValue_2019_07_24.slp (7.1 KB)

Regards,
Anil

Sgarim4
New Contributor II

Thanks Anil, This was what I was looking for.