Hello! I have information for a set of machines and I am trying to display only the latest values for various fields for each unique serial number. So for ex if I have:
serial# 1, temp: 100, color: red, date: 7/1/2018
serial# 1, temp: 100, color: red, date: 7/2/2018
serial# 1, temp: 100, color: red, date: 7/3/2018
serial# 2, temp: 99, color: blue, date: 7/1/2018
serial# 2, temp: 99, color: blue, date: 7/2/2018
serial# 2, temp: 99, color: blue, date: 7/3/2018
then my table should only show:
serial# 1, temp: 100, color: red, date: 7/3/2018
serial# 2, temp: 99, color: blue, date: 7/3/2018
Since serial 1 and 2 are unique and the 3rd of July is the most recent date.
Is this possible?
Hey, can do. Terms on serial number and then you're looking for the top hits metric with a size of 1 sorted on your date field for the other columns.
Top hits lets you grab n values in a bucket and take the min, max, concatenation, or sum of them. Sorting by date with a size of one will give us the most recent number.
Thank you very much for the reply!
This works but I was trying to make a table of the information. Do you happen to know if there is any way to do that (sorry I should have specified that in the original question).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.