> Can I access the time variable in Signoz for ...
# support
s
Can I access the time variable in Signoz for dashboard queries?
Yes, you could use
{{.SIGNOZ_START_TIME}}
and
{{.SIGNOZ_END_TIME}}
.
If not then what is it’s purpose for in the dashboard tab?
The configure tab allows you to define a variable whose values are queryable from ClickHouse.
t
Thanks for the help, I appreciate it. So can I use it like
WHERE timestamp BETWEEN {{.SIGNOZ_START_TIME}}  AND {{.SIGNOZ_END_TIME}}
or will I have to convert them?
s
The precision is in millis so depending on the target column you would have to convert.
The result should have a time type column, one float column and any number of optional string columns. Only the string labels columns in the result can be used for legend formatting.
a
@Srikanth Chekuri 👆 is part of any docs? If not we should add
t
Okay one of the things that confused me was using variables in the Legend Format. For example I have variable called Workflow which I use in my queries but the Legend Format can only use variables within the query not the ones defined outside of the query. So I couldn’t use workflow but I can use serviceName.
s
You can only use the labels that are part of the query response because we wouldn’t know anything about the workflow in the response time series. If you want to have a workflow in legend formatting, aggregate group by workflow, and you will be able to use it.