Filter data based on Year

Hi Team,
i have attached a test file in which i want the BOT to filter the data just for current year and previous year i.e. 2019 and 2020…for this filtering the BOT has to refer “withdrawn date-key” column. Can anyone suggest how it can be achieved?

Hi @som17

As you mention but the file is not attached to the post.

So can you attached the required file and explain the query in more detail

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

TEST.xlsx (924.1 KB)

Hi @som17

Below is the workflow for the same :-
MainPratik.xaml (10.3 KB)

Output :-

image

image

image

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

i want to write the filtered data to the same excel sheet

can you please provide the workflow where the excel sheet contains only the filtered data

Hi @som17

Below is the updated workflow for the same :-
Main.xaml (12.7 KB)
TEST.xlsx (925.4 KB)

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

hey…i have used assign function and instead of hardcoding taken currentyear= system.datetime.now.year
and lastyear=currentyear-1
variable type int32…and then i passed into query
(From d In dtSheet.asenumerable Where d(1).ToString.Contains(LastYear.ToString) Or d(1).ToString.Contains(CurrentYear.ToString)).ToArray
it is throwing error

Hi @som17

I have updated the workflow without hard coding the value but it haven’t given me any error

Current Year = DateTime.Now.Year.ToString
Last Year = ((DateTime.Now.Year)-1).ToString
This is what i have used

Below is the updated workflow for the same :-
UpdatedMain.xaml (13.0 KB)
TEST.xlsx (925.4 KB)

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Hi @som17

If my solution helps you then plzz mark it as solution and like it :sunny:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like