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

Button on VA Report to "Clear all Filters"

 

i sometimes have multiple filters on tab on a report in VA.

is it possible to provide a button or link on a report that clears all the user entered filters?

1 ACCEPTED SOLUTION

Accepted Solutions
Renato_sas
SAS Employee

 That's correct. This capability doesn't exist, but I'd like to suggest a workaround that hopefully will help you.

 

First, you will need a source table with one character column (you can call it Reset_Release for example) and two rows, like below (make sure that table is loaded in memory):

 

Reset_Release source table

 

Next, add a button bar object to your report and assign the Reset_Release column to its category role. Create and assign a character parameter (let's call it p_Button) to this button bar. Make sure that Required is checked under the button bar Properties tab. Optionally you can make the button to grow vertically instead of horizontally, which is the default, and it would look like this:

 

Reset button

Suppose you have a category called Product that you want to add to a control object. Create a calculated item (let's call it Resetable Product) that is defined with the expression below. Observe that the yellow rectangle contains an empty string "" (missing), and not "text string" (but it could actually contain any value that does not exist as a product in our particular case - for example, it could be something like "Click Release to populate" - this will get clear at the end).

 

Expression for Resetable Product

 

Assign Resetable Product in the category role of your control object.

 

To reset values that might be selected in the control object, you must first click on Reset, then click on Release in the button bar.

 

When you click on Reset in the button bar, Resetable Product resolves to missing and the control object will display only the missing value. At that moment, if there were products selected in the control object, the selections would be lost. When you click on Release in the button bar, Resetable Product resolves to Product and the control object is populated back, but none of its values will be selected.

 

Best,

Renato

 

View solution in original post

4 REPLIES 4
WKruk
Fluorite | Level 6

I'm afraid there is no such button available in VA. However you can get the same effect by refreshing a report. This trick clears all filters and recovers a start version of the report 🙂

Renato_sas
SAS Employee

 That's correct. This capability doesn't exist, but I'd like to suggest a workaround that hopefully will help you.

 

First, you will need a source table with one character column (you can call it Reset_Release for example) and two rows, like below (make sure that table is loaded in memory):

 

Reset_Release source table

 

Next, add a button bar object to your report and assign the Reset_Release column to its category role. Create and assign a character parameter (let's call it p_Button) to this button bar. Make sure that Required is checked under the button bar Properties tab. Optionally you can make the button to grow vertically instead of horizontally, which is the default, and it would look like this:

 

Reset button

Suppose you have a category called Product that you want to add to a control object. Create a calculated item (let's call it Resetable Product) that is defined with the expression below. Observe that the yellow rectangle contains an empty string "" (missing), and not "text string" (but it could actually contain any value that does not exist as a product in our particular case - for example, it could be something like "Click Release to populate" - this will get clear at the end).

 

Expression for Resetable Product

 

Assign Resetable Product in the category role of your control object.

 

To reset values that might be selected in the control object, you must first click on Reset, then click on Release in the button bar.

 

When you click on Reset in the button bar, Resetable Product resolves to missing and the control object will display only the missing value. At that moment, if there were products selected in the control object, the selections would be lost. When you click on Release in the button bar, Resetable Product resolves to Product and the control object is populated back, but none of its values will be selected.

 

Best,

Renato

 

sai222
Calcite | Level 5

Hi renato_sas 

how can u have new column  Reset_Release in source table

can u brief about that

Thank You

Renato_sas
SAS Employee
Hi,



You can simply create an Excel or csv file with one column and two rows and have it loaded in memory, or, depending on your current source table, you might be able to derive the new column Reset_Release from your existing table, without the need to load a new one. I have not tried it yet, but this is how it would work:



Suppose you have in your source table a column called Gender, which values are "M" and "F". You could create a calculated item or a custom category to map "M" to "Reset" and "F" to "Release". Even if your chosen source column has more than two values, such as Continent, with 7 distinct values, you could map 4 or them to be "Reset" and the rest to be "Release". You could also use a numeric column to derive the new Reset_Release column. Imagine your numeric column has values ranging from 1 to 10. You could say that values less than 5 would be mapped to "Reset" and the rest to "Release". The most important thing in this process is that you must guarantee that there will be at least one value in your data that will be mapped to "Reset" and at least one value that will be mapped to "Release". If you can't guarantee that, the loading a small table like I've explained above is your only option.



Best,

Renato


SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 9652 views
  • 2 likes
  • 4 in conversation