Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
Michael_Tarallo
Employee
Employee

mitul.png
In this week's edition of the Qlik Design Blog, I'd like to introduce Mitul Vadgama. Mitul is a member of our Qlik Consulting Services team in the UK. He has worked on a variety of consulting projects using both Qlik Sense and QlikView with many enterprise customers. His passion is transforming data into valuable business insights, knowledge sharing, and enabling customers to get the most value out of Qlik products. Mitul is going to show you how to optimize a powerful and unique capability in Qlik Sense, Smart Search. Thanks for your valuable contribution Mitul!

Smart Search

Smart Search provides powerful functionality allowing users to search dimensions and values found within an application’s data model. When working with customers on consulting projects I have found that sometimes the business users, data architects, and app designers want to control which fields are included or excluded in the search. Did you know that you can control which fields are included or excluded from Smart Search?

Here is an example using Smart Search in action where I search for “Rob” in my sales application:

1.png

You can see Qlik Sense finds the value “Rob” in the following fields:

•    First Name

•    SalesPerson

•    CompanyName

•    ContactName

Consider a scenario where you want Smart Search to exclude searching in the “ContactName” field when the users search. You can achieve this by inserting the exclude clause in the Search statement in your script.

The Search statement

The Search statement is a script function used for including or excluding fields in smart search.

It can contain two clauses:

Syntax:

  • Search Include *fieldlist
  • Search Exclude *fieldlist

In our case I want to exclude ContactName from my results. I do this by opening my data load editor and typing in the following right after the SET statements:

Search exclude ContactName;

2.png

....and reload.

When I search again for “Rob” you can now see ContactName excluded from the results:

3.png

Tip: If you want to exclude multiple fields, simply list the fields you want to exclude using comma separators while ensuring your field name syntax is correct.

Search exclude field1,field2,field3;

Another common scenario may be you want to hide most of the ID fields from your Smart Search (maybe because they are only needed for the data model building process).

A possible way you can achieve this is through the following syntax:

4.png

The above contains two lines of code:

  • Search Exclude '*ID';
  • This excludes all fields ending with ID from searches in Smart Search.

  • Search Include CustomerID;
  • This includes the field CustomerID in searches in Smart Search.

This way I am ensuring all but one ID field is included in my Smart Search.

We hope through this post you can see how the Search syntax along with Exclude and Include keyword clauses is a simple yet powerful way to control which fields a user can search on your Qlik Sense application. It also speeds up the search index creation when the data model is first loaded.

For a full list of services offered by Qlik Consulting check out: http://www.qlik.com/us/services/qlik-consulting.

Regards,

Mitul Vadgama

Consulting Services, UK

For more information on the Smart Search feature check out these videos:

10 Comments
robert99
Specialist III
Specialist III

Hi Mitul

Thanks for this post. Very useful to know

0 Likes
5,728 Views
Not applicable

Excellent post.

Thank you for sharing.

0 Likes
5,728 Views
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Mic & Mitul,


Thanks guys for sharing your knowledge and I must say Search Exclude & Include functionality is good to know.

Just on that note I thought what if Developers will like to give the power back to user (all in the name of self-service) to govern what field(s) they will like to exclude/include from the global search. I thought what if you maintain a flat file and users can exclude/include fields as they deem fit. So I created a small App and loaded list of field name to exclude and concatenate these fields with comma delimiter, and passed my variable into the search exclude keyword and it worked

//  all this after global variables created by Qlik Sense

tmp:

LOAD *

FROM [lib://DataFolder/Exclude.xlsx] (ooxml, embedded labels, table is [0]);


LET v_Fields_To_Exclude = CONCAT('List',',');

DROP TABLE tmp;


SEARCH EXCLUDE '$(v_Fields_To_Exclude)';

OR

SEARCH INCLUDE '$(v_Fields_To_Include)';

Hope this helps someone

5,728 Views
chatrapathyv
Partner - Contributor
Partner - Contributor

Is there a way to exclude a field from regular search or filters also? We have about 80 columns and quite a few columns have mostly non distinct values. When we reload the app, app is taking quite a bit of time to index the values of these various columns. Users dont need filter capability on these columns. Wondering if there is a way to exclude these columns from indexing

0 Likes
5,728 Views
Not applicable

Hi Mitul,

Excellent article. This is something that we wanted to achieve in our current project.

Thank you.

Regards,

Pramod K

0 Likes
5,728 Views
mikaelsc
Specialist
Specialist
5,728 Views
Anonymous
Not applicable

Hello good afternoon.

Thanks for this contribution Mitul, it really is very interesting

0 Likes
4,662 Views
Not applicable

Excelent! Thanks!

0 Likes
4,662 Views
passionate
Specialist
Specialist

@Michael_Tarallo 

How different it's from HidePrefix?

0 Likes
4,384 Views
Michael_Tarallo
Employee
Employee

hi Passionate - sorry for the delay - I was on a business trip and I don't always get the notifications when someone tags me - HidPrefix is for hiding columns that are displayed in the fields list - this capability listed in the blog is used to exclude fields from the search index so they don't pop up or display when using the global smart search bar - hope that helps

0 Likes
4,346 Views