Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Filtering a text field if it contains a specific word

Reply
Occasional Contributor
Posts: 18

Filtering a text field if it contains a specific word

Hi,

I'm not sure if this is possible or not, but thought I would raise the question. I've got a set of data which contains around 5,000 lines of free text which I would like to simply search for a specific keyword such as 'zip' or 'bow' for instance, so that the results are filtered. However, using the text input control, it only allows me to return an exact match of a string of text. Am I missing something obvious here, or is this potentially a feature on the horizon? I'm using SAS VA 6.2.

Kind regards,

Alex

Occasional Contributor
Posts: 18

Re: Fitlering a text field if it contains a specific word

Just to add, I know this can be done by applying a manual filter if you have the authority to use the report builder options, but I want standard report viewers to be able to easily control this.

Alex

SAS Employee
Posts: 70

Re: Fitlering a text field if it contains a specific word

Hi Alex,

As you said, an on-report keyword search filter would require a filter expression created in the designer, and the keyword couldn't be modified by report consumers in the current and previous releases of Visual Analytics.  However, in the upcoming 7.1 release, targeted for this fall, you will have a new parameterization capability that will enable you to create a filter control that uses additional operators, such as contains, startswith, endswith, etc.  Essentially, you'll be able to create numeric and character parameters and use them in both filter and calculation expressions, among other things, and associate a parameter with input controls that you place on the report for viewers to change.  To meet your text search filter requirement for report consumers in 7.1, you first create a parameter in the designer, and then a filter expression that references this parameter.  Then, you associate that parameter with an input control, like the text input control.  Not only does this allow you to use operators other than equality for report consumer filter selections, a parameterized filter expression allows you to have multiple filter controls that are ORed.  As you likely know, multiple on-report filter controls in the viewer are implicitly ANDed in 6.4 and prior releases.

Alex, I hope this helps.

Rick Styll

Occasional Contributor
Posts: 18

Re: Fitlering a text field if it contains a specific word

Posted in reply to RickStyll_SAS

That's really useful to know, and i'll keep an eye out for it in the next version!

Many thanks,

Alex

Occasional Contributor
Posts: 10

Re: Fitlering a text field if it contains a specific word

Hi

Is there now a "how to guide" on how to do this?

 

Im struggeling with how to create the parameter to obtain this.

 

Trport with a textbox where user enters value -> report filtered by user entry where variable contains "user entry text"

 

Your help is much obliged

 

 

SAS Super FREQ
Posts: 296

Re: Fitlering a text field if it contains a specific word

Posted in reply to sveinola_gundhus_tv2_no

Hello,

 

To create the parameter, you can right-click the Parameter heading in the filter editor and select Create Parameter. Then you can use the parameter in your filter expression, which might look something like 'Body'n Contains 'Parameter 1'p

 

To enable the viewer to specify the parameter value, create a "text input" control and assign the parameter to the Parameter role for the text input control.

 

Does that help?

 

Thanks,

Sam

Occasional Contributor
Posts: 10

Re: Fitlering a text field if it contains a specific word

[ Edited ]

Hi,

Thank you very much. This was great help.

 

Br

Svein

Contributor
Posts: 21

Re: Fitlering a text field if it contains a specific word

Thank you so much,this was really Helpful!!!!

Ask a Question
Discussion stats
  • 7 replies
  • 2168 views
  • 5 likes
  • 5 in conversation