Hi Everyone
I have difficult exercise when want to sort and arrange data from excel to another file.
The source file and destination file I want as below picture and attached file.
I want to find the model which has " capacity " column largest and " % " column largest and write one by one to destination file with format is fixed .
Pls kindly support me this exercise.
Thanks in advance!
Source.xlsx (8.3 KB)
Destination.xlsx (8.7 KB)
1 Like
One of the solution is that you use Sort Data Table activity.
Excel application scope > Read Range
Sort DataTable
Excel Application Score > Write Range
You probably can also use just the Sort Table activity, but i already had this.
SortTable.xaml (6.8 KB)
2 Likes
Hi @srdjan.suc
Thanks you but that is not solution for me.
1 Like
hi @amaresan
Thanks you but you can make a XAML file for this?
I want to sort base on 2 condition :
It will sort with capacity column descending
If the model has capacity same, it will sort base on % column descending.
1 Like
amaresan
(Amaran)
July 15, 2019, 8:34am
6
@trunghai
Put below code in if condition
dt.Rows.IndexOf(dt.AsEnumerable().Where(Function(row) row(0).ToString.Contains(“%”)).ToArray()(0))>0
true then put sort by % column otherwise sort by Capacity col
2 Likes
Hi @amaresan
thanks you but I want it sort descending with condition : the Capacity is largest , if the capacity same then it sort with % largest.
And I want after sorting, it will write into the destination file with format as below.
Thanks you!
Destination.xlsx (8.7 KB)
1 Like
amaresan
(Amaran)
July 15, 2019, 9:08am
8
@trunghai
Sorry i did’t understand your requirement properly
You have two Option
Excel wise
Sql Datatable wise
Excel wise
1.Use Click Home ->Click Sort&Ascending → choose Z to A
2. Use Tranpose formula
Sql DataTable wise
Use Connect Activity
wirte Sql query for Ascending and Povit table(Which means Tranpose)
2 Likes
Hi @amaresan
Thanks you so much but I want to use uipath to do this case although VBA can resolved.
1 Like