BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
smm662002
Quartz | Level 8

Hi,

 

VIYA 2023.03

 

I would like to create a a dynamic title for a graph chart, where the text displayed to change based on a selection from the graph chart. The method I used so far is using a button bar (similar approach presented in https://communities.sas.com/t5/SAS-Communities-Library/How-to-customize-your-SAS-Visual-Analytics-re...) but because I also have a page filter, every time I select a different value in the filter, the graph changes and there is no selection and hence the button bar display all the possible values. The button bar will display only one value only after I make a new selection in the graph chart.

Would anyone have any ideas how to stop the button bar changing when I change the filter value?

 

Or maybe a different approach not using "button bars" but "text content" and parameters (for this method I couldn't save the graph selection to the parameter)?    

 

Thank you,

smm662002

1 ACCEPTED SOLUTION

Accepted Solutions
HunterT_SAS
SAS Employee

Text with a parameter would be the cleaner approach I think, but it's a little tricky. You are right that you cannot set a parameter from a graph, but to work around that you can do the following:
1. Add a drop down list with the same category you are using in your chart.

2. Set the drop down list to Required

3. Create a character parameter and assign it to the drop down list.

4. Create a filter interaction from the chart to the list control

5. Add a text box and add whatever text you want plus the parameter. 


As you click through the chart, the drop down list should update, setting the parameter, and then updating the text box. Something like this:

HunterT_SAS_2-1708092853553.png

 


Then you could take it a step further and use a precision container to hide the drop down list from view (put it behind the bar chart for example).

 

One downside to this approach, when you do not have any selections in the chart, the parameter is still going to be set to either the default value or whatever was previously selected. Here I de-select the 'Ford' bar in my example, but Ford is still set in the drop down list and therefore the parameter:

HunterT_SAS_3-1708092868907.png

 

 

I haven't found a way around this yet. 


If you want to stick with the button bar approach, a separate datasource might work for the button bar. As long as the page filter prompts aren't mapped to it then they won't filter it,  BUT you'd still have to have one mapping from the chart to the button bar which might get you in the same situation anyway. 

 

Alternatively, you would have to abandon using page filters and move all of those prompts to the body of the report, then just not have an action between the prompts and the button bar. I don't believe there is going to be an easier way around that.  



View solution in original post

1 REPLY 1
HunterT_SAS
SAS Employee

Text with a parameter would be the cleaner approach I think, but it's a little tricky. You are right that you cannot set a parameter from a graph, but to work around that you can do the following:
1. Add a drop down list with the same category you are using in your chart.

2. Set the drop down list to Required

3. Create a character parameter and assign it to the drop down list.

4. Create a filter interaction from the chart to the list control

5. Add a text box and add whatever text you want plus the parameter. 


As you click through the chart, the drop down list should update, setting the parameter, and then updating the text box. Something like this:

HunterT_SAS_2-1708092853553.png

 


Then you could take it a step further and use a precision container to hide the drop down list from view (put it behind the bar chart for example).

 

One downside to this approach, when you do not have any selections in the chart, the parameter is still going to be set to either the default value or whatever was previously selected. Here I de-select the 'Ford' bar in my example, but Ford is still set in the drop down list and therefore the parameter:

HunterT_SAS_3-1708092868907.png

 

 

I haven't found a way around this yet. 


If you want to stick with the button bar approach, a separate datasource might work for the button bar. As long as the page filter prompts aren't mapped to it then they won't filter it,  BUT you'd still have to have one mapping from the chart to the button bar which might get you in the same situation anyway. 

 

Alternatively, you would have to abandon using page filters and move all of those prompts to the body of the report, then just not have an action between the prompts and the button bar. I don't believe there is going to be an easier way around that.  



sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 413 views
  • 0 likes
  • 2 in conversation