BookmarkSubscribeRSS Feed
Milton
Calcite | Level 5

Using SAS Viya 3.05, VA 8.5.2

Experience level: Novice

 

Hi, and thanks for any help.

 

I am successfully using the method noted here to reset most filters in a VA report using a single button:

https://communities.sas.com/t5/New-SAS-User/One-button-to-reset-all-filters-SAS-VA-8-2/td-p/523400

https://communities.sas.com/t5/SAS-Visual-Analytics/Button-on-VA-Report-to-quot-Clear-all-Filters-qu...

 

However, it doesn't seem to work for text input filters. Is there any way to apply this, or a similar solution, to a text input filter?

 

Ideally, I'd combine this with a CSV filter, using an approach similar to this:

https://communities.sas.com/t5/SAS-Visual-Analytics/Filter-list-object-using-multiple-text-box-entri...

 

The end result I'm looking for is a CSV text box (contains) filter, where the user can enter 1-20 filters, i.e.

      Filter = "Toyo, Nissan, Honda, Chev"

      Returns Toyota, Nissan, Honda, Chevy, Chevrolet

 

Which can then be reset using a button.

 

But if I can't achieve that, a series of text input filters will be my fallback...but I still can't seem to get text boxes to reset with the button

 

Code for resetting filter:

parameter:  reset_all, reset_tab, reset_subtab

calc_field_1 (repeated for tab, subtab):

     IF ( 'reset_all'p = NOT)

     RETURN 'reset_filters'

     ELSE 'resetting'

calc_field_2 (actual filter):

     IF ( ( 'reset_all'n  =  'reset_filters' ) OR 

     ( 'reset_tab'n  =  'reset_filters' ) OR

     ( 'reset_subtab'n  =  'reset_filters' ) )

     RETURN 'car_make'n

     ELSE 'click again to reset'

 

Advanced Filter Code for CSV filter:

     'car_make'n Contains GetWord ( 'car_make_input'n,1 ) OR

     ( 'car_make'n Contains GetWord ( 'car_make_input'p,2 ) AND ( GetWord ( 'car_make_input'p,2 ) NotMissing ) OR

     ( 'car_make'n Contains GetWord ( 'car_make_input'p,3 ) AND ( GetWord ( 'car_make_input'p,3 ) NotMissing ) OR

     ... to 20

 

This is the simplified version, there's also text tidy up stuff (UpCase, etc.) embedded as well.

 

WHY am I doing this, and why can't I use a different approach?

I have  dashboard with a LOT of filters, spread across multiple tabs, subtabs, scrolling containers, etc. to allow the users to slice and dice many different ways. Many of the input values are narrative text and/or have numerous values, so drop downs wouldn't work. It'd be horrendous for the users to try and hunt down all the filters to manually reset them, and I want to provide the option to reset all, reset tab, reset subtab, etc.

 

Thanks very much!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 0 replies
  • 708 views
  • 0 likes
  • 1 in conversation