Problem when filtering data using the filter data table activity

hello community!
I have a table in which my dates are in the following format:
Here are some examples: 20/Feb/2024
13/May/2024
25/Jun/2024
15/Jul/2024
my activity is configured as follows, follow print:

Inglês
porém o filtro não funciona, me retorna todos os meses e não só julho, como eu quero.
However, the filter doesn’t work, it returns to me every month and not just July, as I want.
Would you help me? Thanks!

@amanda.gondim,

You should be passing column names index will not work. Pass like this “Column1” in Coluna.

Thanks,
Ashok :slight_smile:

@amanda.gondim

 filteredRows = (From row In DT.AsEnumerable()
                    Where DateTime.ParseExact(row("DateColumn").ToString(), "dd/MMM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MMM") = "Jul" AndAlso row("YourColumn").ToString().EndsWith(StrVar)
                    Select row).CopyToDataTable()


Please use this linq query inAssign activity

Please pass the column name not column index

1 Like

Hello @rlgandu
my table has no header :confused:

@amanda.gondim

Then use index in linq query it will work like

row(1).ToString()

when doing the filtering on string base

Assign Activity:
dtFiltered =

(From d in dtDataVar.AsEnumerable
Let v = d(22).toString.ToUpper.Trim
Where v.Contains("JUL") AndAlso v.EndsWith(str_ano)
Select r = d).CopyToDataTable

Handling empty filter result we can adapt as described here:

Datatables can’t have no headers. If you used Read Range without headers, then your datatable has headers Column1, Column2, Column3, etc.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.