Is there a way to custom sort on multiple columns with datatable?
The current Sort Table Table activity only accepts 1 column name.
I would like to sort on two columns, Tax Invoice No. and Status. Thanks for the help in advance!
Book1.xlsx (10.9 KB) - Example File
Hi @Md_Hidayat ,
Refer to the following thread, it explains the sorting of data table based on multiple columns.
How about the following?
dt = dt.AsEnumerable.OrderBy(Function(r) r("Tax Invoice No.").ToString).ThenBy(Function(r) if(r("Status").ToString.IsNumeric,CDbl(r("Status").ToString),0)).CopyToDataTable
Sample20230418-5L.zip (14.7 KB)
If you can ignore blank cell in Status column, SortRange activity also help you.
You Can sort Multiple columns by using the Excel Modern Activity
If you are classic user, try this to enable the Modern activity,
- Click Filter icon in Activity Panel
- Enable the Moder option,
- Now search the Excel application scope and Sort Range.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.