Finding highest value

This is the two input sheet and I want to get the search for highest salary in the each department and then print it out in another sheet with (name,salary,department name) for those who have the highest salary.

And this is the expected output

Hi @Rawan_Ghurab,

Please find the StudioX project in the zipped attachment. I used latest Community Version to build it.

FindHighestSalary.zip (248 KB)

Quick explanation of the code :

  1. Use the Excel Application Scope activity to open an Excel workbook located at “Data.xlsx.” and Read “Departments” and “Employee” sheets. Also Sort the Employee sheet by salary descending so we don’t need additional logic for calculating the greatest salary.

  2. Build DataTable called dtFinalData.

  3. For each department row - filter Employee dt by id of department row. Loop through the filtered row to ask which employee has the same salary as the employee which is on top of the filtered table.

  4. Add only found rows to the dtFinal.

  5. Write dtFinal to Results sheet.

image

Hope it helps! :robot:

1 Like

Awesome Answer

Thanks BogdanTod for your effort the solution was very helpful.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.