Hello All,
Can any one please let me know how can i get the sum of the data which is seperated by week wise .
And every week the data may or may not change.
Example:
Thanks in advance
Padmini
Hello All,
Can any one please let me know how can i get the sum of the data which is seperated by week wise .
And every week the data may or may not change.
Example:
Thanks in advance
Padmini
Hello,
It is excel data
Hmmm what exactly do you want to do in your xaml.Based on my perspective you can get the sum value of column in excel using formula or just click the sum functions in excel ? But if you want to get the value using uipath is doable.
Just asking
cheers
Happy leaning
Hi,
Can i get the sum value for each week as u can see i have data seperated week by week using uipath?
And, this data will not be same every week. So for dynamic data how can we do sum?
Regards
Padmini
@chandrashekar_padmin
Is that a static position of sum,Because if we have a static positon we can set the range of uipath and get the sum every week.
cheers
Happy learning
No it is not static, it is dynamic.
If it is static we could have done using sum function itself.
Can you send me your excel file I will try it tomorrow. Once done I will notify you.
cheers
Happy learning
Not sure if I understand your problem correctly but could you not loop trough the datatabel (excelData) and do the sum yourself in UIPath?
And then write this back to excel?
Hello @pattyricarte ,
Yea sure … i have attached the excel to you.
Please let me know if it works.
Thanks,
PadminiTest.xlsx (10.1 KB)
Hello,
Should i do this in excel application scope.
I will try this and let you know if it works.
Thanks,
Padmini
Yes you can do this in the excel application scope
connect the scope to the correct workbook
use a readRange activity to get the data in a dataTable variable
then use the code shown above
and after that use writeRange to write the data back to your excel sheet
If you would like to iterate through each row in a datatable, please use “For Each Row” activity instead of “For Each” activity, Otherwise set the type argument as “System.Data.Datarow” in your “For Each” activity.
Hello,
I tried the code but it did not work as expected.It says input is not in correct format.
Please let me know if i need to make any changes to xaml.
Thanks,
PadminiTest.xaml (10.0 KB)
The issue may be with your values in the price column. It contains special characters like "$"
and ","
.
Please change your sum calculation to ,
sum = sum +Int32.Parse(("price").ToString.Replace("$","").Replace(",",""))
and try again.
Warm Regards,
Nimin
Same issue
Hi chandrashekar_padmin,
A few things I noticed when trying your workflow. The sheet name could be something else depending on your excel language (for me I had to change it to blad1 since that is sheet1 in dutch)
second in the sum part in the then clause you have: sum + Int32.parse(“price”)
this should be: sum + Int32.Parse(row(“price”))
And as sugested by nimin, we need to remove the $ and , to make it work:
sum + Int32.Parse(row(“price”).ToString.Replace(“$”,“”).Replace(“,”,“”))
last, your sum variable is string, change this to Int32 and change the “0” to 0
hope this will solve the issues
also make sure that on the placed I put “price” you put the header name of your price column
Test.xaml (10.5 KB)