I created a parameter on product that I added as a role to a button bar. I then added it to a text Box. When the button is clicked it will display the product in the text box (part of a title). If nothing is clicked it says "<No Item Selected>.
Is there a way to get this to say "All Products"
The first pragmatic approach is to prefix the parameter in the text box with the reading "Filter applied".
the second solution is a workaround with a dummy data set which you can use for the button bar design, this prevents the data from being filtered.
You can customized categories on the dummy char var, here 3 brands + "All products".
you assign a parameter to it which will be used in the object filter.
I attach screenshots.
IF ( 'selected'p = 'All Products' )
RETURN ( 1 = 1 )
IF ( 'selected'p = 'Volkswagen' )
RETURN ( '_brand'n = 'Volkswagen' )
IF ( 'selected'p = 'Audi' )
RETURN ( '_brand'n = 'Audi' )
IF ( 'selected'p = 'SEAT' )
RETURN ( '_brand'n = 'SEAT' )
ELSE ( 1 = 2 ) ) ) )
Thanks for the quick reply. I'm probably not following since these don't seem to be working. Are all three screen shots part of the same solution or the code for the dummy dataset? I tried creating a calculated item but I get type mismatches.
I can get the filter to show All Products in the Text box but as soon as you click another filter it defaults back to <No Item Selected>. Ugh
you have to create the dummy_va table via data step in sas studio.
once done, load into the report.
1) apply customized category matching your class variable levels that you use currently. Add "All Products" for all remaining values
2) at page expand level use this newly created custom category in a button object INSTEAD of the one you're using currently
3) assign a parameter to this button bar
4) use the parameter in the text box
5) use the advanced filter option for the object being filtered
6) paste the logic of my previous post and adapt it to your class level names
data casuser.dummy_va(promote=yes); do number=1 to 25; num_char=put(number,best12.); output; end; run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.