Sort Excel Table First by String Column then Date Asc/Desc

Hello!
Here is some sample data for what I am trying to achieve: I first want Key Words to be grouped ascending alphabetically and then have a second sort for the date column by either ascending or descending. I have tried using the Sort Data Table activity but this only sorts by 1 column, and I understand that there is a “From row In table” statement that will likely be the solution. I am specifically struggling with understanding how to set up the dates and have not found a clear answer in other topics. Any help is appreciated, thank you!

Hey @MK50,

Have a look on this:-

Thanks,
Sanjit

1 Like

Hello @MK50 ,

Welcome to UiPath Forum!

To Sort the table in Ascending order for column “keyWord” and in Descending Order for Column “EndDate” you can use the below method. (By using 2 Assign Activities )

TestDt.DefaultView.Sort = “[KeyWord] ASC, [EndDate] DESC”
TestDt = TestDt.DefaultView.ToTable

image

Let me know if you face any challenges in implementation.

Regards,
Rohith Prabhu

1 Like

Perfect, that is very simple! Thank you very much, Rohith.

1 Like

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