How to filter and groupby datatable column based on highest value

get highest value from colD groupby ColA & ColB

Input
ColA ColB Colc ColD
901 501 123 1
901 501 189 2
201 101 77 3
201 101 88 4
901 501 33 5
301 233 11 6
Output
ColA ColB Colc ColD
901 501 33 5
201 101 88 4
301 233 11 6

@Aravinthan

  1. Sort datatable by ColA, colB, colD Desc
    (you can refer other topic about sort datatable by mutiple colums in forum
    e.g. Sort Excel by multiple column)
  2. Set variable
    strPrevioursColA = “”
    strPrevioursColB = “”
  3. For each row in data table
  • if (strPrevioursColA = “” ) or ( strPrevioursColA <> “” AND strPrevioursColA <> row(“colA”) AND strPrevioursColB <> row(“colB”) )
    Set strPrevioursColA = row(“colA”)
    Set strPrevioursColB = row(“colB”)
    Output row to excel or other datatable as you want