Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
Jennell_McIntire
Employee
Employee

One of the great features in Qlik Sense is the Smart Search capabilities.  Smart Search allows you to search the data in your app when you are on a sheet.  All you have to do is select the Smart Search icon on the selection bar and type what you want to search for.  In the image below I start typing “fresh vegetables” and data that matches “fresh” or “ve” (the start of the word “vegetables”) is displayed.  From here, I can select one of the items found if it is what I am looking for.  I will select “Fresh Vegetables” in the Product Sub Group Desc field and this selection will be added to the selection bar.

search fresh veg 2.png

One thing I should note is that I did not use quotes when I searched for “Fresh Vegetables” so “fresh” and “vegetables” were interpreted as separate search terms.  If I use quotes, my search returns less results (seen in the image below) because my search term was more specific and considered one search term versus two.

search fresh veg with quotes.png

Now if I want to perform another search, I can do so and it will automatically search within my selections which is Fresh Vegetables.  If I search for broccoli, all possible data will be displayed within my Fresh Vegetables selection.

broccoli.png

Now say I search for something that is not within my Fresh Vegetable selection like apple.  I will be given a message indicating that no matches were found and will be prompted to start a new search for only apple if I chose.  If I select the “Start a new search …” button, then my Fresh Vegetables selection will be de-selected before the search begins.

apple.png

By default, Smart Search searches all fields in the data model but you have the option to set what fields you would like to include or exclude in the Smart Search.  This can be done in the script by using the Search Include or Search Exclude statements:

Search Include * fieldlist

Search Exclude * fieldlist

Fieldlist is a comma separated list of the fields that should be included or excluded in the search.  The Search Include statement is used to indicate which field(s) should be searched when performing a search.  In some apps, there may be several fields that the user may not need to search.  In that case, it is smart to use the Search Include to narrow down the list of fields to search.  This can help with the performance of the search as well.  The Search Exclude statement is used to indicate which field(s) should not be used in the search.  This may be used to exclude ID or key fields that were used to build the data model but that the user does not need to search.  In both statements, wildcard characters * and ? can be used.  Just to show you how this works, if I add the Search Exclude statement below to my script and reload, it will exclude all values in the “Line Desc 1” field when a search is being performed.

Exclude.png

In the Master Items, the “Line Desc 1” field is added as a Dimension named Product.  When I performed the search earlier, broccoli results were found in the Product dimension.  Now watch what happens when I do another search for Broccoli within my Fresh Vegetables selection.  Broccoli does not come up in my search results because the exclude statement does not allow a search in the “Line Desc 1” field/Product dimension.

search broccoli with exclude.png

Smart Search provides an easy way for users to find the data they are looking for to filter their data.  The Search Include and Search Exclude statements offer the developer a way to control the fields that can be searched.  This can improve performance and it can make it easier for the user to focus on the fields that are most relevant.  Keep these statements in mind the next time you are developing an app.  It will improve the users search experience.

Thanks,

Jennell