How to sort data table by custom sort

How to sort data table by custom sort ?
current data:
image

Expected Result::
image

sort column B by custom sort.

@fairymemay

Mark as solution if this helps

Thanks

@fairymemay
As IT IS Not a sorting on Letter ASC or desc you can customized e.g with the Help of dictionary or Array Index

Define a dictionary of String, int
Add items to IT dictSort(“inter”)=0, local 1…

So with the lookup from value to Level IT can be sorted by

Yourdatatablevar.asenumerable.orderby(function(r ) dictSort(r(indexorcolname).toString.trim)).copytodatatable

1 Like