I have a metric, in my case from prometheus, which I have to substract a constant from. Easy so far, but this value have to be “20” after Nov 1st, and “10” before Nov 1st

I’ve tried to connect a local Test-DB and made a CSV like:

First, what I would do is obtain the epoch timestamp for the date of interest, which is 1667260800 for GMT. Then, you can get the difference between the current time and the timestamp using time() - 1667260800. The PromQL functionsgn(...) returns the sign of the parameter, so sgn(time() - 1667260800) returns a step function where it is -1 before Nov. 1, and 1 after Nov. 1. I think you see where this is going now. Now you can manipulate that function to be equal to 10 before Nov. 1 and 20 after Nov. 1. My final function is:

((sgn(time() - 1667260800) * 5) + 15)

Which is a valid instant vector. You can then subtract (or add, multiply, etc.) this from any valid Prometheus query. Let me know if this worked for you!