Red
Red

Reputation: 43

Kusto query with filter depending on dashboard parameter

I want to be able to toggle a filter on my query via a parameter in dashboard. How can I turn the "where" operator off?

E.g. the parameter in the dashboard is "_toggle"

let _filter = dynamic(["A", "B"]);
Table
| where id in (_filter)  // execute this line only if _toggle == true
| project id

I already tried creating a second list containing all the ids and toggle between the small an the complete list via iff() but this is too resource intensive.

Upvotes: 0

Views: 1592

Answers (1)

Yoni L.
Yoni L.

Reputation: 25895

you could try something like this:

let _filter = dynamic(["A", "B"]);
Table
| where _toggle == false or id in (_filter)
| project id

Upvotes: 2

Related Questions