Agnetha
(Agnetha Bellman)
December 2, 2021, 1:56pm
1
Hi everybody,
is there a way to remove rows in a datatable at once? (Highlighted in yellow) The rows always have the same cell notation:
"Vormontage: Bandmotoren,
Vormontage: Gestell + A-Box GLM-Ievo
Vormontage: Halter Bottom + Eti Bottom
Inbetriebnahme: GLM-Ievo
So, if the cells exist they should be removed from the data table.
Additionally, the column “Dauer der Bearbeitung” has to be sumed up.
Do I need to save the Datatable in Excel? The Datatable is extracted from SAP and if it’s possible I don’t want to save it in Excel.
Thanks a lot for helping!
Greetings
Agnetha
Hi @Agnetha
Try with filter datatable by giving
“Vormontage:*” as your value
Regards
Sudharsan
1 Like
Srini84
(Srinivas Kadamati)
December 2, 2021, 2:28pm
4
@Agnetha
Try as below for the removing rows which has the notations you listed
You can add as many notations according to your use case
make sure that Remove rows are selected
Thanks
1 Like
Srini84
(Srinivas Kadamati)
December 2, 2021, 2:30pm
5
@Agnetha
For sum all values check below post
Hi there @yogeshgyw ,
Please try the following:
dtTesting.AsEnumerable.Sum(Function (x) If(Double.TryParse(x.item("Column2").ToString, Nothing), Double.Parse(x.Item("Column2").ToString), 0))
This will convert the DT to an enumerable, then SUM the column value (as a double) if it is valid, otherwise it will simply add 0.
You will need to change the references for the DataTable (dtTesting) and columns (“Column2”).
Apologies for the delay, please let me know if it works!
Thanks,
Josh
Hope this will help you
Thanks
Hi ,
For your requirement invoke code is the best solution. We can write vb.net code to filter the rows with the specific word and delete them at a single shot.
Atlast we can use write cell activity to insert sum formula to sum the values.
In the above case no need to insert data table into Excel. Datatable concept will not come into picture. Thanks.
Agnetha
(Agnetha Bellman)
December 2, 2021, 4:07pm
7
Hi all,
thanks to all of you for the input Removing the rows by filtering worked perfectly!
1 Like
Srini84
(Srinivas Kadamati)
December 2, 2021, 4:08pm
8
@Agnetha
Glad, My inputs helped you
Happy Automation
Thanks
system
(system)
Closed
December 5, 2021, 4:09pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.