Hello! i need to sum up one column in excel and display them in a message box as “total price is ____” how do i do that?
Hi @meli
Use Read Range Workbook to read your excel
create a variable called totalPrice as string
in assign activity, use
totalPrice = your_dt_variable.AsEnumerable.Sum(Function (x) CDbl(x(“Price”).toString.Trim).ToString
Then use it in your Message Box the totalPrice variable
Use this one
Read Range Workbook from Workbook Activities
Then pass the full path of Excel File and the Sheet Name
Ah, i think i do not have that activity
Coud you share screenshot of project dependencies ?
do i copy the ‘x’ and CDbl?
i have no idea whats that, could you explain please?
Please use the workflow attached as reference
SumExcelColumn.zip (49.0 KB)
the code line is about LINQ
x acts like like a local variable representing the looped Datarow like
For each row in DataTable Acitvity
Also have a look here
It says document invalid .(
Could you share some screenshot ?
By any chance do you have another workflow i can refer to?
Could you share what Studio version are you work with ?
- First drag excel application scope and give the excel path there …inside that activity drag read range and use it…that should solve the issue
To get sum use this in message box dt.AsEnumerable.Sum(function(x) cdbl(x("Price").ToString)).ToString
Where dt is the output of read range activity
Cheers
Yes!! this is what i need to get!! how do u do that
what do i write for ‘x’ or do i js keep it as ‘x’
I am sorrh i am not sure