Custom Sort Multiple Columns

Hi all,
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

Raw Sheet
image

Sort Preference
image

Desired Result
image

Regards
Hidayat

Hi @Md_Hidayat ,

Refer to the following thread, it explains the sorting of data table based on multiple columns.

Regards,

2 Likes

Hi,

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.

Regards,

1 Like

Hello @Md_Hidayat
You Can sort Multiple columns by using the Excel Modern Activity
image

If you are classic user, try this to enable the Modern activity,

  1. Click Filter icon in Activity Panel
  2. Enable the Moder option,
  3. Now search the Excel application scope and Sort Range.

Thank you Vishal!

1 Like

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