Using Template variables to disable metrics

I’m using template variables to query tags from an sql source before passing these tags to OpenTSDB to query the actual time series data. The issue is, if the SQL source returns a tag that doesn’t exist in opentsdb for some reason, the whole panel doesn’t work. Is there a way to disable specific metrics if the tag returned doesn’t exist?