Dear all,
I have a multi-select template variable named unit2 which lets the user select one or more tag values for the ‘unit’ tag in my data. I want to fetch the distinct values of the ‘con_StackTrackingNumber’ field across all the selected ‘unit’ tag values. However, the query seems to always fetch the results based on the first tag value only. How can I fix it? ChatGPT couldn’t help
from(bucket: “hsl_5m”)
|> range(start: 2000-01-01T00:00:01Z)
|> filter(fn: (r) => r[“_measurement”] == “internal”)
|> filter(fn: (r) => r[“unit”] =~ /^${unit2:regex}$/)
|> filter(fn: (r) => r[“_field”] == “con_StackTrackingNumber”)
|> distinct()