Duplicate datapoints at window borders

Hi

I would like to have two additional datapoints in my query. I want to duplicate the last datapoint to the end of the query window and the previous value of before the window copied to the start of the window.

So if I have
*1____*2_____*3_____*4
____|-----window------|
I would like to get 1,2,3,4 where 1 ist at the start and 3 at the end of the window.
I can copy the last point to the end of the series manually in C# but I would like to have it in a query. Just dont know if its possible.

So far I have:

fields = ["Example"]
from(bucket:"MyBucket")
|> range(start: 2022-02-23T11:01:02Z, stop: 2022-02-23T11:03:00Z)
|> filter(fn: (r) => r["_measurement"] == "measurement")
|> filter(fn: (r) => contains(value: r._field, set: fields))

Thanks for the help in advance.