Unable to solve the excel task. what activities to use?

Marksheet Data__ (1) (1).xlsx (13.9 KB)
unable to solve to problem .Requirement is on the other sheet(Description sheet)
help out guys


Hey @opkushwaha999

You will need to use a combination of for-each, if, assign


1 Like

Hi @opkushwaha999

You can proceed like this





The xaml file is attached
ExcelTask.xaml (8.4 KB)

1 Like

great to see bro. but i am unable to understand as you have used linq. can you make the process more simpler ?

Hi @opkushwaha999 ,

We notice from the Excel, that the Total Marks is already calculated. We could use that to make the Approach Simpler. However, we would be using Linq queries with slightly less complexity.

  1. First, since we would know the Subject names before hand, we could use an array or a List and initialise the List/Array with the Subject names.
subjects = {"English","Urdu","Physics","Math","Chemistry","Biology"}

here subjects is a Array of String Variable.

  1. Next, As we would need to Rank Based on their Total Scores, we could Order the Datatable rows based on their Total Mark values, like the below using an Assign Activity :
DT = DT.AsEnumerable.OrderByDescending(Function(row)CDbl(row("Obtained_Mark").ToString)).CopyToDataTable
  1. Next, we can loop through the Ordered Datatable and Update the AT_KT and Rank columns like shown below :

AT_KT column is Updated based on the Assumption that the, We would want to Count the Number of Subjects having Less than 40.

Rank column is updated by providing the index of the For Each Row Activity. Since the Datatable is already Ordered Based on the Marks Obtained, we would just require to increment and Update Rank Column for Each Row.

Check the Below Workflow :
DT_Update_Values.xaml (8.2 KB)

1 Like