Fetching Latest 2 records from Lookback API

52 Views Asked by At

We are in situation where We Need to fetch last two records from Lookback API every time .

For the below case, we need the records highlighted in green,

enter image description here

We are doing the incremental fetch using the _ValidFrom Date in Lookback API. We need last two records so that we can handle the updates happening to _ValidTo whenever new snapshot is created.

1

There are 1 best solutions below

1
Kyle Morse On

You should be able to get that data from just the most recent snapshot can't you? The _ValidFrom of the most recent should be equal to the _ValidTo of the second to last one.