(From row In dtInput.AsEnumerable()
Group row By Brand = row.Field(Of String)("Brand") Into Group
Let sortedGroup = Group.OrderBy(Function(x) x.Field(Of Double)("Value"))
From item In sortedGroup.Select(Function(x, index) New With {
.Brand = x.Field(Of String)("Brand"),
.Value = Convert.ToInt32(x.Field(Of Double)("Value")), ' Convert to Int32
.Priority = If(index = 0, "HIGH", "LOW")
})
Select dtOutput.Rows.Add(item.Brand, item.Value, item.Priority)).CopyToDataTable()
@tharani.natarajan to build the data table in the required format you can follow the approach suggested by @lrtetala and to add the priority, either you can use a switch case where two cases you can add high and low, and based on the Priority column of each row you can add the queue item or you can use the API call to add bulk upload you can take a reference from official documentation Orchestrator - Transactions Requests