Sort Datatable with Multiple columns (Custom Filter in excel)

Hi,

I/m not sure if I am creating a duplicate thread, if yes then apologies for that but I checked all possible threads.

I need to sort my datatable first with 2 columns (data type String), then with date.

SortExcel.xlsx (16.7 KB)

I have already tried converting the datatable to dataview and sort the dataview(myView)

myView.sort = “Status,Desc,Delivery Date Asc”,

This dosent sort the date, any suggestions please.

What i want is to use a custom sort as below:

Regards
Anshul

@ANSHUL

Check below thread to sort the data.

2 Likes

Hi
In addition to what @lakshman mentioned
Kindly try with this query in a ASSIGN activity to sort any number of columns of any type

datatablevariable = From x In datatablevariable.AsEnumerable() Order By convert.Tostring(x(“columnname1)”),convert.ToString(x(“columnname2”)) Select x).CopyToDataTable

Similarly we can include any other columns we want and if we want to sort integer instead of Convert.ToString mention as Convert.ToInt32

Cheers @ANSHUL

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