Hello!
So, I have a custom variable $tickettype with two values (A, B). They will be used to filter some panels. I can do it writting directly on the query “where value in (‘$tickettype’)”. But, I want to use the [Transformations] > [Filter data by values] option to achieve that.
If I select one single value, the filter bellow works fine:
If I select both values it doesnt. How can I achieve that?
Txs.
Hi,
My wild guess is - you can’t. When you select “All”, you have All
string, and I guess none of your ticket_types have “All” in them. You could try to play around with formatting but I’m not sure such behavior is supported.
Why not in datasource though? I’ll let myself cite someone (probably a fellow Grafana Champion but I’m not sure which one
) “Grafana is best at visualizing data, everything else should be done on datasource side” (unless there’s no other way).
1 Like
Txs Dawid!
What I´m trying to achieved is having panels at the top, showing the total values. Below I want show the same data, but filtered with the $tickettype values, so I dont have the rewrite the query again.
As the second panel has the first one as a datasource (panel source), the only way to filter it is using the transformation option.
Ok,
in that case, something like this should work:
Notice that I changed Contains substring
to Regex
and I added the :regex
formatting after the name of the variable. I tested it with a variable that also allowed multi options and it worked. Hope that helps (Grafana 11.4.0)
2 Likes
It works! Txs a lot Dawid!
1 Like