how to calculate sum of particular column using UiPath C#
Hey @Ram_Gurav1
Please try the below,
dt.AsEnumerable().Select(row => row("SumColumn")).Sum()
Hope this helps.
Thanks
#nK
not work i am using Uipath C#
Hi,
Can you try the following expression?
dt.AsEnumerable().Sum(r=>Double.Parse(r["ColumnName"].ToString()))
Regards,
Exception has been thrown by the target of an invocation.
Hi,
Can you share $exceptionDetails at LocalsPanel when exception occurs?
If your data contains non-numeric data including blank, the following will work
dt.AsEnumerable().Where(r=>Double.TryParse(r["Column2"].ToString(),out dummy)).Sum(r=>Double.Parse(r["Column2"].ToString()))
Note: dummy is double type variable
Regards,
Dear Sir,
i am using Uipath C#
because above given formula not working, i need help in Uipath C#
particular column sum
Hi @Ram_Gurav1 ,
Could you Provide us a Screenshot of What is the Error that you face ?
Or if you can Explain as to what is not working it would help us to understand the situation better.
Hi,
In my environment, the above expression works as the following.
Can you share your project as a file?
Regards,
hi Sir,
not work
hii @Ram_Gurav1
please do below steps
once adding extension in project.json file , save your current project and close the uipath and json file and reopen uipath and check
please check whether you are passing the correct datatable name and column name
if it is not working in assign try using invoke code activity and pass the arguments properly
the expression given by @Yoichi is correct , please cross check from your side
Hi,
Can you try the following steps?
First, can you try to run the following xaml file in your environment?
Sequence.xaml (8.2 KB)
If it works, these remove activities in the above xaml and copy your activities to it, then run.
Regards,
given xaml file not work
project open in VB not in C# , cant find solution
Hi,
Can you try to replace or add the xaml file to your existing C# project, then run?
Regards,
thank you its work