Based on the table below, I need two tasks.
1. Sort out the data descending for dates
2. Have a way so that I can only retrieve the latest information.
Meaning if I ask for Pen, I should only get a value of X
Similarly for XYZ, I should only get a value of N
<table style="padding-right: 2pt; padding-left: 2pt; font-size: 11pt; font-family: Calibri,Arial; background-color: rgb(255, 255, 255); width: 235px; height: 197px;" border="1" cellpadding="0" cellspacing="0"><colgroup> <col style="FONT-WEIGHT: bold; WIDTH: 30px"> <col style="WIDTH: 64px"> <col style="WIDTH: 64px"></colgroup> <tbody> <tr style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"> <td> Date
</td> <td>A</td> <td>B</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">
</td> <td style="BACKGROUND-COLOR: #99cc00">Types
</td> <td style="BACKGROUND-COLOR: #99cc00">Value</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5 Oct</td> <td>Pen</td> <td style="TEXT-ALIGN: right">X</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5 Oct</td> <td>Pencil</td> <td style="TEXT-ALIGN: right">Y</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5 Oct</td> <td>Pencil</td> <td style="TEXT-ALIGN: right">H</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><table style="width: 42px; height: 20px;" border="1" cellpadding="0" cellspacing="0"><tbody><tr><tr style="HEIGHT: 18px"><td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4 Oct</td></tr></tr></tbody></table></td> <td>Glue
</td> <td style="TEXT-ALIGN: right">Q</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1 Oct
</td> <td>Pen</td> <td style="TEXT-ALIGN: right">N</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">27 Sep
</td> <td>Glue</td> <td style="TEXT-ALIGN: right">T</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2 Sep
</td> <td>XYZ</td> <td style="TEXT-ALIGN: right">N</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2 Sep
</td> <td>XYZ</td> <td style="TEXT-ALIGN: right">X</td></tr></tbody></table>
1. Sort out the data descending for dates
2. Have a way so that I can only retrieve the latest information.
Meaning if I ask for Pen, I should only get a value of X
Similarly for XYZ, I should only get a value of N
<table style="padding-right: 2pt; padding-left: 2pt; font-size: 11pt; font-family: Calibri,Arial; background-color: rgb(255, 255, 255); width: 235px; height: 197px;" border="1" cellpadding="0" cellspacing="0"><colgroup> <col style="FONT-WEIGHT: bold; WIDTH: 30px"> <col style="WIDTH: 64px"> <col style="WIDTH: 64px"></colgroup> <tbody> <tr style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"> <td> Date
</td> <td>A</td> <td>B</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">
</td> <td style="BACKGROUND-COLOR: #99cc00">Types
</td> <td style="BACKGROUND-COLOR: #99cc00">Value</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5 Oct</td> <td>Pen</td> <td style="TEXT-ALIGN: right">X</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5 Oct</td> <td>Pencil</td> <td style="TEXT-ALIGN: right">Y</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5 Oct</td> <td>Pencil</td> <td style="TEXT-ALIGN: right">H</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><table style="width: 42px; height: 20px;" border="1" cellpadding="0" cellspacing="0"><tbody><tr><tr style="HEIGHT: 18px"><td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4 Oct</td></tr></tr></tbody></table></td> <td>Glue
</td> <td style="TEXT-ALIGN: right">Q</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1 Oct
</td> <td>Pen</td> <td style="TEXT-ALIGN: right">N</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">27 Sep
</td> <td>Glue</td> <td style="TEXT-ALIGN: right">T</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2 Sep
</td> <td>XYZ</td> <td style="TEXT-ALIGN: right">N</td></tr> <tr style="HEIGHT: 18px"> <td style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2 Sep
</td> <td>XYZ</td> <td style="TEXT-ALIGN: right">X</td></tr></tbody></table>