How to sum column up in excel and into a a text box


I want to sum the Amount due part How?

1 Like

Hi @ADELARD_KAZUMA_HO

Once you read the data into a datatable use the following in assign to get the sum


Dt.AsEnumerable.Sum(function(x) cdbl(x(“amount due”).ToString))

The output is of type double so create a variable of type double and use it

Cheers

1 Like


I ran out of replies … Can you show me an example of what you mean by variable of double part
@Gokul001

1 Like

Hi @ADELARD_KAZUMA_HO

In the expression dt is the datatable you read from excel which in your case is dtread so replace it

And create a variable of type double from variable panel and use it in the left side of assign

Cheers

1 Like

@ADELARD_KAZUMA_HO

Did it work or are you facing any issues?

Cheers

1 Like

Hi @ADELARD_KAZUMA_HO

How about this expression

(From d in dtData.AsEnumerable Where Not (isNothing(d(1)) OrElse String.IsNullorEmpty(d(1).toString.Trim)) Select v = CDbl(d(1).toString.Trim)).Sum(Function (x) x)

Check out this XAML file

SumExcelColumn.xaml (16.2 KB)