0
votes

I need to extract the data of employees from an Excel sheet. The Excel sheet contains the DoB and I need to assign salary according to the DoB. The person born before 1995 will be credited a salary of 50000 and person born after 1995 will be credited a salary of 20000.

I had tried and there was an issue with the date.

UiPath Studio

1
Please go to the UiPath Academy. Your question is very basic and easy to be done. What did you try so far? - kwoxer
I had done the excel formula, copied that to the write cell and the problem worked. But I need to try another method. I Need to done this fully within the UiPath. I compared the date in each row item and got the DoB that born before 1995. But I don't get the logic like How to assign the salary. - sonia
Upload some image about the Excel file and about the current state of your Workflow. - kwoxer
sir I am a new user so i cannot add image into this.I need to earn some points. - sonia
Sheet 1 Id Name Dob sheet 2 Id Salary - sonia

1 Answers

1
votes

Filtering like the one you need could be done using LINQ but if you are new to VB.NET this may be a little bit too complex approach. I would suggest using For Each Row cycle to go throuh each DataTable row and use VB.NET DateTime.CompareTo method for comparing two dates (DOB from Excel and 1/1/1996). You already have the IF statement in your workflow, just use Assign activity to set the salary column, like this: Left part of the Assign: row("salary") Right part of the Assign: 50000 (or 20000) Then you could save your calculation back to Excel by using Write Range activity