As far as I've understood your intention, you could probably do it this way:
... | where if("$click.value$" == "Totals", true(), $click.name$ == "$click.value$")
Edit:
Here's how you could use the eval command to create conditions for a search:
<some search conditions> [ | stats count | eval search=if("$click.value$" == "Totals", "*", "$click.name$=\"$click.value$\"") | fields search ]
The subsearch (within the square brackets) will expand to an additional search condition for the outer search. (The stats count part is just used to great a single result, thats rather hack/workaround)
... View more