Absolute time range from variable

i use a variable to define the timerange to select data from my database.
it works.
But how can i pass the time range to my varibale

for example:
i choose 4 days with the variable.
So i select all datas since the last 4 days.
Now i need to reset the time range to the 4 days.
how can i do it automatically?
i can’T set the variable in the time range field?

thank you