yundw
(Yundw)
September 10, 2020, 12:35am
1
안녕하세요
DT의 조건 정렬을 하려고합니다.
I want to sort the condition by the STRING value of the PART column.
(From x In DT_1.AsEnumerable() Order By convert.Tostring(x(“Date”)), convert.ToString(x(“Part”)) Select x).CopyToDataTable
Processed as above, but detailed conditions for the PART column are required.
order by 1.FFFF 2.AAAA 3.TTTTT
Please help.
Hi @yundw
Did you try the Sort Data Table activity? It’s much simpler to use.
yundw
(Yundw)
September 10, 2020, 3:33am
3
In the activity
Is it possible to sort by string for PART column?
The sort order should be like this.
1.FFFF 2.AAAA 3.TTTTT
Try this xaml: Sort_DT.xaml (7.1 KB)
yundw
(Yundw)
September 10, 2020, 3:57am
5
Thank you but
What I want is condition 1, the date is correct
I want to manually specify the sorting of the PART column in condition 2
Please check the photo in the question again
@yundw If you want to manually specify the sorting order of alphabets, do you have like a list or any other collection for that?
@yundw Can you share your sample Excel file? Is it like you only want to sort this DT with 5 rows? I cannot give you a dynamic solution for this, kindly elaborate.
If you are interested in creating custom sort function, you can also try this:
http://csharp.academy/custom-method-of-sorting-strings/
yundw
(Yundw)
September 10, 2020, 7:01am
8
You may or may not refer to the collection.
It is not just a sort of [descending], [Ascending] for a specific column value of order by
I would like to specify the sort value of the column of PART.
Hey, @yundw ,
In order to do this, I’d suggest to use a separate array that specifies the order you require.
Give a try to the following workflow:
CustomOrderArray.xaml (5.6 KB)
Happy automating!
1 Like
yundw
(Yundw)
September 10, 2020, 8:22am
10
I think I can solve it thanks to you
1 Like
system
(system)
Closed
September 13, 2020, 8:22am
11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.