Help with custom vega visualization

Hello

I'm new in Vega visualization, is it possible to create a visualization to compare 2 different dates in the same period?

Something similar to timelion offset, for example today between 10 AM and 11 AM and last week with the same period but with a control in the visualization to modify -7d, -15d or another value without changes the code of the visualization?

Thanks

Yes, this is possible. If you take a look at the docs here you can see about the shift property:

https://www.elastic.co/guide/en/kibana/7.4/vega-querying-elasticsearch.html