I am minusing first column with 3rd column both column values are same so that I can get output as 0 but getting difference as 1
hi try to debug it by outputting column 1 and column 3 just before its doing calculation and screenshot it here
regards
ahmad
I am getting this output after running 435 rows I would take long time to debug it
just put
log activity inside the for each
counter=counter+1
log activity = counter
log activity = clumn 1
log activity =column 3
with this we can see on log which data its processing and used on the calculation
Hi @Gopikrishna_S ,
instead of for each loop cant we use excel formula to calculate the difference between first row and third row and use autofill activity to auto fill all the rows it will be very quick and will do the operation directly on excel. thanks.
How to do it
Use Write cell activity and write as below expression
Later you can use Autofill activity and pass the range as @kirankumar.mahanthi1 suggested
Hope this will help you
Thanks
ok. please follow the below steps.
-
Use work book read range to store the entire excel data into data table and use the following expression to calculate the row count = ouputDT.rows.count
-
Use write cell activity to insert the formula in the sepcific column and sample formul alike =A2-C2
-
Use auto fill range activity and use source as D2 and fill range D2:D+rowcount
Please refer the attached work flow for more guidance. thanks.
AutofillDemo.zip (9.0 KB)
did you mean log message
yes if you want to do some debug , but you can also use solution provided by @kirankumar.mahanthi1 and @Srini84
Can we use Wook book activity instead of excel apllication Scope
Write cell and auto fill range activities will not work with out excel application scope. we have to keep these activities inside excel application scope. if you are using modern activities replace excel application scope with use excel file activity. thanks.
For 435 rows it won’t take hardly more than 3-4 seconds
Fine hope the below steps with simple FIR EACH ROW activity and a write range from workbook activities will help you resolve this
-
Use a read range activity from workbook activities and mention the file path as input and get the output as dt
-
Now use a FOR EACH row activity and pass dt as input
-
Inside the loop use a Assign activity like this
CurrentRow(“last_columnname”) = (Convert.ToDouble(CurrentRow(“First_columnname”).ToString) - Convert.ToDouble(CurrentRow(“third_columnname”).ToString)).ToString
- Then use a WRITE RANGE activity from workbook and mention the input as dt and enable add headers property
Cheers @Gopikrishna_S
Hi @Gopikrishna_S ,
Could you share your work flow.
use range like the following “J2:J”+RowCount
RowCount should be the variable to get the row count from the data table which we have got from read range activity. thanks.
Use like following “J2:J”+RowCount.tostring
it calculated values for only two rows only bro…Should I need to use for each activity to repeat for all the rows
No need to use for each row bro it is considering one row as header. In work book read range activity un check checkbox for add headers bro. it will work fine.