Using Smart Search

Smart Search is a new feature of Qlik Sense. As with most search features, you type in what you are looking for and a list of possibilities are returned. These are based on the field values in your data. This recipe shows you how to tailor what is returned when performing a smart search.

Getting ready

For the purpose of this recipe, we will make use of an inline data load which gives the release information for different labels. Load the following data in the script load editor:

Data:
LOAD * INLINE [
    Label, DJ, Next Album Release, Release Year
    Blunderbuss Records, Kevin Mullaney, The Chat, 2016
    Weirdo Cats, Heather McKay, Unknown, 
    Dragon Disks, Rhys Hayward , Unknown, 
    Caped Capers, Simon Conyers, No Fashion, 2016
    Shadow Giggles, Ski Mask, Electro Ski, 2015
    Fiddle Pits, Isabel Franken, Boogie Fingers, 2015
]; 

How to do it…

  1. Open the main content pane and click on the How to do it… button in the top-right corner.
  2. Type ski into the search box and note that two values are returned, as shown in the following image:
    How to do it…
  3. Now, go to the script editor and type in the following code:
    Search Exclude "Next Album Release", "Release Year";
  4. Save and reload the application.
  5. Repeat step 2. This time, only a single value is returned in the smart search results.

How it works…

In this example, we used the Search Exclude function to restrict two fields from the Data model we don't want users to be able to search on. The fields are called Next Album Release and Release Year. There is also a Search Include function, where listing only the fields you want users to search on is simpler than listing those you don't want to include. Examples of fields you would normally exclude are Key fields that join the tables in your Data model. Removing unnecessary fields also helps with the performance of searches.

There's More….

Other than just controlling what fields are accessible via the smart search functionality, there are different ways to perform a search. This involves using special characters other than just typing in the literals you are looking for. Examples are given in the following table:

Character

Example

Description

" "

"Orange Juice"

Encapsulating the value in quotes makes Qlik Sense search for the whole word instead of Orange and Juice separately.

+

+Orange +Juice

Finds strings that include both words although they can be in any order. Such words could be Orange and apple juice or Juice from oranges.

~

~Orange

This is Fuzzy Search, where the values are ranked and sorted according to the similarity to the search string. This search only works when selecting the search icon for an individual field and does not work in the global search at the top of the screen.

>, <, >=, <=

=Sum(Sales)>100

Expression searches also only act on a single field similar to Fuzzy Search. The results are returned based on the aggregation. Numeric searches such as >01/01/2015 also work without an explicit aggregation function and can be used to narrow down the search.

*

Oran*

The * symbol is a wildcard character and will return any values that start with the letters Oran. The wildcard character replaces a single or block of characters in a search string. It can be used at the start and middle of a search string, for example, *Oran, Oran*, or *Oran*.

?

Oran?e

The ? character is also a wildcard that represents a single character.

QlikView also has other types of searches, such as Numeric, Fuzzy, Expression, and Compound Search. I believe these are on the road map, although they are not included in the product to date. To see if these features have been released in later versions of Qlik Sense, please refer to the Qlik Sense online help feature accessed via the hub.

See also

  • Using smart data load profiling
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset