Lea
October 8, 2019, 1:05am
1
Hi,
I have this excel file.
There are 6 stores in this file, and I need to split data by each store and save in 6 different excel files.
For example,
File 1 should be Header + Whole rows for Store A + SUM
File 2 should be Header + Whole rows for Store B + SUM
File 3 should be Header + Whole rows for Store C + SUM
…
Can anyone help me solving this?
Thanks in advance!
1 Like
sumire
(mitsuko kurata)
October 8, 2019, 1:54am
2
use “Filter Table” activity
you can filter your table by “Store” column.
Hi @Lea
FirstVariableDT= DtExcel.Select([“Store” =‘A’]).copyDatatable
Then save it to excel.
Then do it to another store.
cheers
Happy learning
1 Like
lakshman
(Ganta lakshman)
October 8, 2019, 2:53am
4
@Lea
Welcome to the uipath community.
First use Read Range activity to read the data and will give you output as DataTable and say ‘DT’.
And then use below query to find all unique stores.
storeDT = DT.DefaultView.ToTable(true,"Store").CopyToDataTable
And then use ForEach Row activity to iterate one by one store and find all rows.
ForEach Row in storeDT
filterDT = DT.Select("Store = '"+row("Store").Tostring+"'").CopyToDataTable
And then write into Excel file using Write Range activity.
Range: “Sheet”+flag.Tostring
DataTable: filterDT
Note: where flag is Integer variable and intialize to 1 and increment it one by one.
1 Like
Lea
October 8, 2019, 6:30am
7
I’m new to RPA (UiPath) and I still do not follow your solution even though I tried…
Do you mind if I ask to share the workflow? (Sorry, I can’t attach the excel file cause I’m not allowed to…)
Thanks again!
Lea
October 8, 2019, 6:32am
8
I’m new to RPA and having a hard time learning.
Thanks for your help!
1 Like
No worries @Lea
Happy to help here just post your inquiry here and surely somebody will address it
cheers
Happy learning
2 Likes
lakshman
(Ganta lakshman)
October 8, 2019, 4:38pm
10
@Lea
May I know what error are you getting here ?
Lea
October 9, 2019, 11:36pm
11
@lakshman
storeDT = DT.DefaultView.ToTable(True,“Store”).CopyToDataTable
→ It says ‘CopyToDataTable’ is not a member of ‘System.Data.DataTable’.
lakshman
(Ganta lakshman)
October 10, 2019, 2:00am
12
@Lea
Check below thread and follow the steps to resolve this issue.
AsEnumerable is not a member of 'System.Data.Datatable'