Hi all,
I am trying to use streamstats to display an event for a particular user, their current Payment Number for this month, and the subsequent Payment number for the next event. (Do note that I sort the date in reverse order).
| sort -TransactDate
| streamstats current=f window=1 last("Payment Number") as NextPaymentNumber
| table Username, "TransactDate","Payment Number", NextPaymentNumber
I almost get the result I want as below:
Username TransactDate Payment Number NextPaymentNumber
Adam 2/2/2017 2 3
Adam 2/1/2017 1 2
However, what I need is something like below:
Username TransactDate Payment Number NextPaymentNumber
Adam 2/3/2017 3 3
Adam 2/2/2017 2 3
Adam 2/1/2017 1 2
Where the record on 2/3/2017 is the latest record, and the latest and maximum Payment number is 3.
Please advice how could I achieve that? Thanks!
... View more