How to filter Datatable based on a year?

Hello,

am reading data from an excel file, and I want to keep only entiers those are from year 2020.

Table looks like (.xslx is attached)
|30.04.2020|10.000.000|10.045.000,00|EUR|100,223|10.022.300,00|0|-22.700,00|-22.700,00|
|10.06.2022|3.000.000|2.991.337,50|EUR|100,475|3.014.250,00|22.912,50|0|22.912,50|
|23.06.2021|15.000.000|14.954.400,00|EUR|100,565|15.084.750,00|130.350,00|0|130.350,00|
|31.07.2020|11.000.000|11.000.000,00|EUR|100,026|11.002.860,00|2.860,00|0|2.860,00|
|20.01.2023|3.000.000|3.000.952,00|EUR|100,28|3.008.400,00|7.448,00|0|7.448,00|
|27.01.2020|3.000.000|3.000.952,00|EUR|99,78|2.993.400,00|0|-7.552,00|-7.552,00|
|31.01.2020|3.000.000|3.000.952,00|EUR|100,17|3.005.100,00|4.148,00|0|4.148,00|
|10.02.2020|3.000.000|3.000.952,00|EUR|101|3.030.000,00|29.048,00|0|29.048,00|

Somehow filter DT is not recognizing 2020 at all. I can´t get a propers result.

Thanks!

Markyear.xlsx (9.2 KB)

1 Like

Filter Date.ParseExact(0, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture).Year on the left equal to 2020.

3 Likes

Hi Antony,

thanks, but I am still getting an error - “Column type not supported”.

Here is a sequenceYear.xaml|attachment (7.7 KB)

Cheers!

1 Like

I think your link broke. Can you try reuploading the file?

1 Like

Year.xaml (7.7 KB)

yap

1 Like

Change the 0 to "Column-0". I guess it doesn’t like using positional arguments.

1 Like

Hi Anthony,

thanks! The step works, but new error is thrown:

image

I tried with writing 2020 and “2020” - same issue.Year.xaml (7.8 KB) year.xlsx (9.2 KB)

1 Like

You could use Starts With instead.

Year.xaml (7,7 Ko)

still not working :wink: