saninfo273
(Saninfo273)
February 29, 2024, 6:29am
1
need to remove the row which is empty in all columns expect first columns.
for example datatable,
remove row is 16-30,30 Above,8-15 (because they are empty in all columns)
Date
column1
column2
column3
column4
column5
column6
column7
1-3
17
10
15
4
47
15
56
16-30
30 Above
3-7
9
4
3
14
4
1
8-15
Total
26
14
18
4
61
19
57
lrtetala
(Lakshman Reddy)
February 29, 2024, 6:31am
2
Hi @saninfo273
Use Filter DataTable activity
Output:
Cheers!!
rlgandu
(Rajyalakshmi Gandu)
February 29, 2024, 6:31am
3
@saninfo273
Assign activity:
filteredDataTable = (From row In yourDataTableVar.AsEnumerable()
Where Not row.ItemArray.Skip(1).All(Function(x) IsDBNull(x) OrElse String.IsNullOrEmpty(x.ToString.Trim))
Select row).CopyToDataTable
Input:
Output:
vrdabberu
(Varunraj Dabberu)
February 29, 2024, 6:31am
4
Hi @saninfo273
Try this in Assign activity:
Save To: dt
Value To Save: dt.AsEnumerable().Where(Function(row) Not row.ItemArray.Skip(1).All(Function(cell) cell Is DBNull.Value OrElse String.IsNullOrWhiteSpace(cell.ToString()))).CopyToDataTable()
Regards
2 Likes
Hi @saninfo273
and then write range workbook
Hi @saninfo273
Try this:
DT.AsEnumerable().Where(Function(row) Not row.ItemArray.Skip(1).All(Function(x) IsDBNull(x) OrElse String.IsNullOrEmpty(x.ToString.Trim))).CopyToDataTable()
Hope it will helps you
Cheers!!