Hi, I need help regarding excel activity. I have one sheet in which I have to consider combination of 3 columns and according values under these columns, if the values are same for then it should be considered as 1 transaction. Kindly provide guidance.
Can you provide any eg or Screenshot which may explain it more so that it will be easy to give you the solution …
Happy Automation
Best Regards
Er Pratik Wavhal
Maybe like this:
- For Each Row
1.1 IF (row(0)=row(1) AndAlso row(1)=Row(2))
1.2 varResult=row(0)
1.3 Else varResult = row(0).ToString+row(1).ToString+row(2).ToString
The excel sheet format is like below:
Supplier no. Doc Type Doc no. Pay item
1123 PV 4000 002
12121 PV 9001 001
1123 PV 4000 001
I have to take combination of first 3 columns like this 1123PV4000 and find this similar combination in entire sheet which is to be treated as 1 transaction item. I hope it is easy to understand this way.
@chaitanya.panicker I did the same case earlier in my project and its very interesting and easy. Follow the below steps:
- Use Read range activity and store the result in datatable.
- Create a for each row loop for datatable
- Create a list of string (keep it in wider scope of for each loop) and Add column combination into list using Add to Collection
row(0).ToString+row(1).ToString+row(2).ToString - For each iteration check if the list contains the combination if exist then transaction is already processed if not then treat that as a new transaction item.
Hope it will help you🤪
Thanks, I will try it today and let you know if it works