In Excel i have the data as
Value. Year
123. 2022
123. 2022
123. 2021
123. 2021
Above data will be in single Excel i need to update based on year and value in seperate Excel.
So,. 123. 2022
123. 2022 in seperate Excel
And 123 2021
123 2021. In update in seperate excel
ppr
(Peter Preuss)
2
readin the excel with read range - dtData
Variable: TableList - DataType: List (Of DataTable)
Assign Activity:
TableList =
(From d in dtData.AsEnumerable
Group d by k=d("Year").toString.Trim into grp=Group
Select t=grp.CopyToDataTable).toList
So the TableList holds all split datatable
E.g. with a for each loop over TableList you can write out Excel when this is also needed
Need to include 123 also ,if it’s 123 and it has year need to split
ppr
(Peter Preuss)
4
pleas show us sample output as statement is doing this already as mentioned in the req
After splitting using list how to update in seperate Excel
ppr
(Peter Preuss)
6
like following:
for each activity setting TypeArgument is set to DataTable
You will just adapt the logic of the sheet name e.g when using the Year we can do
item.Rows(0)(“Year”).toString.Trim
ppr
(Peter Preuss)
8
It looks more that the Visual representation of the list shows us a result of 2 Datatables where the table name is not set
we dont know what was done / implemented. So give more details when you need more help once you debugged and traced the flow
Also you can check in the immediate panel e.g. TableList.First()
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
In raw view i am getting two datatables how to update in Excel
ppr
(Peter Preuss)
10
we can write back into excel as shown above
Can you explain the highlighted part in yellow
ppr
(Peter Preuss)
12
what value you want to set for the different worksheet names?
Need in different excel not in different sheet
ppr
(Peter Preuss)
15
then just do it similar to
and assign the file path dynamical to the excel scope
DT.Asenumerable.Groupby(Function(r) Tuple.Create(r(“value”),r(“year”))).Select(Function(g) g.copytodatatable).Toarray
Output : Array of Datatables
Take For each (Properties : Argument type : Data table)
Inside for each take write range
system
(system)
Closed
17
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.