Thanks, Arne! You are exactly right, a parameter is an effective way to do this. Here are two possible options:
1. Using Parameters Works on: All versions of Visual Analytics
As Arne hinted, parameters are a very powerful concept and allow you to create things like dynamic variables that let you switch between one or more variables:
To create a dynamic variable with a parameter:
Create a new Character parameter
Create a new calculated variable and add the following code:
if(upcase('Parameter 1'p) = 'LABEL HERE') return 'Var 1'n
else 'Var 2'n
Where 'LABEL HERE' refers to the value of the button the user selected, and 'Var 1'n/'Var 2'n refer to your variables you'd like to switch between. In the image shown above, the labels are "MPG (City)" and "MPG (Highway)."
Add the new calculated variable to your graph
Add a new button bar populated with the label names you would like to use. In the paper Arne linked, p. 6-7 shows one way to achieve this; however, you can create the same labels using your existing dataset. You'll need to be careful so that they do not get filtered out by report-level or page-level filters.
When users select buttons, the variable in the graph will automatically change. The downside of this is that the variable being shown has a static name. You'll want to add the parameter to dynamic text so that users are aware of what they are looking at.
2. Viewer Data Edits
Works on: VA 8.4+
If you change the Viewer Customization level for the report to "Data Edits" under the Report Options pane, report viewers can modify graphs to display which variables they would like to see:
This way the user can create their own analysis with the variables you leave unhidden. Hope this helps!
... View more