I have a code for fetching multiple selected rows. I can get all the rows of data but I am planning to get specific data that is merited. I'm stuck on getting the specific value of merits of each selected row and wanting to do code for their median. Please advise.
const median = {{ employeesTable.selectedRow.data }}
return median
Here is a sample data and what I'd like to get is only the merits which is 10 and 14 for example and get their median.
[{
id:"15"
email:"cornflakes123@gmail.com"
employee_name:"Mark"
merits:10
},
{
id:"12"
email:"fourleaves@gmail.com"
employee_name:"Grey"
merits:14
}]
My desired output to be showing is the median of the merit/s being selected. For example if three rows are selected, their merits are gathered and then given a median.
Example, if the three rows are having the merits of 5, 11 and 12 then the my desired output is to show the median 11 on ''return'' value.