0

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

kwoxer
  • 3,734
  • 4
  • 40
  • 70
sonia
  • 3
  • 3
  • Please go to the UiPath Academy. Your question is very basic and easy to be done. What did you try so far? – kwoxer Oct 20 '20 at 10:31
  • 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 Oct 21 '20 at 05:40
  • Upload some image about the Excel file and about the current state of your Workflow. – kwoxer Oct 21 '20 at 07:31
  • sir I am a new user so i cannot add image into this.I need to earn some points. – sonia Oct 21 '20 at 08:22
  • Sheet 1 Id Name Dob sheet 2 Id Salary – sonia Oct 21 '20 at 08:22
  • Hi, I use the if condition and got the output through writeline like 20000,50000,20000,50000...But how can I write this to the salary column.Can you help?..I need to know where I can store this values and write to the Salary column – sonia Oct 21 '20 at 10:29
  • You can upload images somewhere else (like imgur) and link to them. Link is enough. It's very abstract. I'm not sure if anyone guessing what you really want. – kwoxer Oct 21 '20 at 11:38
  • can you see the image? I need to store the output to a salary column. How that can be done? – sonia Oct 21 '20 at 13:08

1 Answers1

1

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

Ilya Kochetov
  • 17,988
  • 6
  • 44
  • 60