How to get the latest two events using this library?
Say I have the following
time | price
---------------
1000L | 40
2000L | 20
3000L | 80
4000L | 10
5000L | 60
6000L | 30
I want to do operations like
- Get the last 2 events or last 4 events in the past 6 hours
- Difference in price for the last two events in 6 hours.
How to do this using Flint? I can write my own udf and solve this but I am wondering if there is any inbuilt function that is already available?