This data table how to calculate total for all row.

shrtname | KTN | KCN | KHC | KCH | KHO | KSM | KTV | Total |
---|---|---|---|---|---|---|---|---|

07-Mar | 14 | 3 | 13 | |||||

03-Jan | 15 | 30 | 23 | 15 | 47 | 11 | 34 | |

Total | 39 | 30 | 26 | 15 | 60 | 11 | 34 |

This data table how to calculate total for all row.

shrtname | KTN | KCN | KHC | KCH | KHO | KSM | KTV | Total |
---|---|---|---|---|---|---|---|---|

07-Mar | 14 | 3 | 13 | |||||

03-Jan | 15 | 30 | 23 | 15 | 47 | 11 | 34 | |

Total | 39 | 30 | 26 | 15 | 60 | 11 | 34 |

Try this in Assign acitivty

```
dt.Columns("Total").Expression = "[KTN]+[KCN]+[KHC]+[KCH]+[KHO]+[KSM]+[KTV]"
```

Regards

please fully explain it

how to use assign activity

Can you try below

```
(From d In DT.AsEnumerable
Let t = {"KTN","KCN","KHC", "KCH","KHO","KSM","KTV"}.Sum(Function (x) Convert.ToInt32("0" & d(x).toString.Trim))
Let ra = d.ItemArray.Take(d.ItemArray.Length - 1).Concat({t}).ToArray
Select DT.Clone.Rows.Add(ra)).CopyToDataTable
```

Regards,

=> Read Range Workbook

Output-> dt

=> Use below syntax in Assign:

```
Save to: dt
Value to Save: (From d In dt.AsEnumerable
Let t = {"KTN","KCN","KHC", "KCH","KHO","KSM","KTV"}.Sum(Function (x) Convert.ToInt32("0" & d(x).toString.Trim))
Let ra = d.ItemArray.Take(d.ItemArray.Length - 1).Concat({t}).ToArray
Select DT.Clone.Rows.Add(ra)).CopyToDataTable
```

=> Write Range Workbook `dt`

Sequence10.xaml (8.3 KB)

Regards

solve in Datatable???

1 Like

Try this

```
(From d In DT.AsEnumerable
Let t = {"KTN","KCN","KHC", "KCH","KHO","KSM","KTV"}.Sum(Function (x) Convert.ToInt32("0" & d(x).toString.Trim))
Let ra = d.ItemArray.Take(d.ItemArray.Length - 1).Concat({t}).ToArray
Select DT.Clone.Rows.Add(ra)).CopyToDataTable
```

**Input:**

**Output:**

Cheers!!