Ad hoc Value as variable

Hello, is there a way of using the value of an ad hoc filter as a variable.

image

using something like $dimension.value return ‘90’ ?

Im trying to use that value in a Query template

Add code as a regular template variable, otherwise your query has no way of knowing whether the user has added code as an ad-hoc variable or not.