Data table filter based on date range values

DataTable=> I need to filter (Cloumn A) only current week of Thursday to Next week of Wednesday.

Bot Will get Amount values based above mentioned date range filter.

Please help me on this one.

Hello @sankar.mayilsamy

You can use the Filter Datatable activity. Then select the rows and add the condition.

Thanks

Hi @sankar.mayilsamy
Example:

Hi @Raja,

If you can Please the xmal file for this one.

@sankar.mayilsamy Currently I have no file regarding this but I can try to make it

Hello @sankar.mayilsamy
kindly find the Xaml file attached here
Forum_ExcelDayFilter.zip (96.3 KB)

Output is
image

Hi @sankar.mayilsamy,

I worked on @raja.arslankhan provided solution.
Please find attached xaml.

Main.xaml (7.5 KB)

Hello @sankar.mayilsamy try below
Log messaage =

Today.AddDays(- Today.DayOfWeek).AddDays(4) & Environment.NewLine &
Today.AddDays( -Today.DayOfWeek).AddDays(10)

you can use above like

DateTime currWeekThursday = Today.AddDays(- Today.DayOfWeek).AddDays(4)
DateTime nextWeekWednesday = Today.AddDays( -Today.DayOfWeek).AddDays(10)

dt_new = dtInput.AsEnumerable().Where(function(rw) CDate(rw("Date").ToString) >= currWeekThursday AndAlso CDate(rw("Date").ToString) <= nextWeekWednesday).CopyToDataTable

Hi ,

Based on date range condition true need to update Excel Column=>“Yes” else if it is not In between date range Update Excel Column =>“No”.

So How to Use above filtered query apply to IF condition.

below should work for you

DateTime currWeekThursday = Today.AddDays(-Today.DayOfWeek).AddDays(4)
DateTime nextWeekWednesday = Today.AddDays(-Today.DayOfWeek).AddDays(10)

for each row in dt.rows
	if CDate(row("Date").ToString) >= currWeekThursday AndAlso CDate(row("Date").ToString) <= nextWeekWednesday then
		row("In_Range") = "Yes"
	else
		row("In_Range") = "No"
	end if
Next row