get the last record for items
if we have data like
invoice_id invoice_line_id item_id date value
1 1 1 1-1-2017 10
1 2 2 1-1-2017 20
2 1 1 10-1-2017 12
2 2 2 10-1-2017 22
3 1 1 20-1-2017 12.5
4 1 2 22-1-2027 22.5
we want to get for each item the last value by using the maximum date and data will be like this
invoice_id item_id date value
3 1 20-1-2017 12.5
4 2 22-1-2017 22.5