Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Searching in field values is a powerful feature in QlikView (all this should also work in QlikSense, but I haven't tested everything). You can use searches for example in set analysis field modifier, select in field actions and not to forget filtering e.g. list boxes in the frontend.
Hence knowing the power of searches is vital to developers as well as end users.
Unfortunately (in terms of 'getting started with search'), there are several possible search modes, have a look at The Search String to get an overview.
Text searches continues explaining. Some of the search modes are explained a bit more detailed: The Expression Search
And there are some things to consider we would hardly know without following Henric Cronström's ( hic ) great design blog: Search - But what shall you find?
Not to forget, there is a nice cheat sheet: Qlik Sense Search Cheat Sheet, covering some features, but not everything.
There is also of course some documentation in the HELP file as well as the reference manual, but not what I would call a comprehensive documentation of this essential product feature. Especially, there is few documentation about the so called 'compound search'.
So let us shed some light on
QlikView's Compound Search feature
First, let's create some sample data:
SAMPLE:
LOAD RecNo() as Number, Text
INLINE [
Text
Harry
Sally
Harry & Sally
New Hampshire
New York
Something new
UPPER
not upper
Al Bundy
Airport Newark
me
];
[Note: As Henric commented to one of his blog posts, there is no escape character to escape a wildcard, hence if you want to search for e.g. '?', you would need another search mode, e.g. advanced search using =index(FIELD,'?') ]
Another example for the XOR operator would be to find the complement of a search (for example search for *Sally*):
You could achieve this by selecting (Sally), then use the context menu to select excluded, but you can also use a single search: (* ^ *Sally*)
[Agreed, the syntax would be easier if there was an operator for NOT or complement, but I haven't found it so far. If you know it, please drop a comment below.]
All these operators can be used to not only combine two, but many searches: (me|Harry|Sally)
This would be a good point to end this document. But there is something more I haven't read about so far:
You can achieve similar without nesting, but take care of the order of your searches and operators:
Some (or all?) of these results can of course be achieved using other search modes, I just wanted to focus on the compound search mode in this blog post. I hope all mysteries of the compound search have been revealed.
If you have any comments or questions, drop a comment below.
Have fun!
edits:
2016-02-02: Complement can be created easier, just using (* ^ *Sally*), added some more examples, reorganized some parts
Thanks Stefan. Very helpful reference. Surprised that someone rated 4 stars for this article! hard customer to please!!
Thanks Stefan.
Very useful. Very cool.
CB.
Thank you, very useful information.
Many thanks Stefan, I like your work!
I need to put this into a ppt for training. Also thanks to the group for all their comments.
Cheers,
Luis
Thank you Stefan,
I've often referred to Henric's post as a guide, and this adds some new searches I hadn't know prior. Specifically liking the XOR combos for omitting. Thank you!
Great post. I am coming back to it quite regularly 🙂
Although I run into an obstacle that is not described here. I am using compound search for searching of a list of values (strings including spaces). Like this: ("Alert Definition"|"ArchFreeSpace") but for many (50+) values.
It finds
Alert Definition
ArchFreeSpace
ArchFreeSpaceOptional
The last one is unwanted. How to adjust the search to exclude this one...? Thanks to anyone for an advice.
Hello,
Can I use a variable to specify to Items, somethig like (Item1|Item2) but have these values in a variable?
Thank You,
Michael