6 april 2022

Literal values vs search strings in Qlik Set Analysis

Deel dit bericht
This post explains the difference between literal values and search expressions in Qlik Set Analysis.

Every Friday at Bitmetric we’re posting a new Qlik certification practice question to our LinkedIn company page. Last Friday we asked the following Qlik Data Architect certification practice question about search strings in Set Analysis:

A Business Analyst has an app with the communication channels shown in figure 1. Which Set Analysis expression should be used to only show the number of Internal communications?

This is typically a relatively tough question, but fortunately everyone who participated is above average!

The correct answer is D

You may wonder why this is a tough question, that’s because in the past both single and double quotes would be evaluated as a search expression by Qlik. This has lead to single and double quotes being used interchangeably, while formally only the double quotes are correct.

The single quotes (‘) are used to denote a literal value. So by using single quotations in Set Analysis, you are looking for an exact match with that value. In this case the answer B solution will be looking for literally Internal* as field value.

By using double quotes (“) Qlik will interpret this as a search value. In this example, the correct answer D, will be conducting a search for Internal*. The asterisk is a wildcard that can match any (sequence of) character(s). In this case Internal-CallInternal-Chat and Internal-Email would be matched.

What about flag fields?

Yes, if this particular condition is one you want to test more often then it can be beneficial to create flag fields in your data model. This will make your Set Analysis easier and in cases more performant as well. In the context of this question though, we only wanted to test if you knew the difference between single and double quotes in Set Analysis. We’ve already established that you’re all above average 😉

That’s it for this week. See you next Friday?

Take your Qlik skills to the next level!

Since 2013, the Masters Summit for Qlik is the premier advanced training for Qlik. Join us in Vienna and take your Qlik skills to the next level.

Join the team!

Do you want to work within a highly-skilled, informal team where craftsmanship, ingenuity, knowledge sharing and personal development are valued and encouraged? Check out our job openings.

Expressions Friday Qlik Test Prep Set Analysis Solution

Hoe kunnen we je ondersteunen?

Barry beschikt over meer dan 20 jaar ervaring als architect, developer, trainer en auteur op het gebied van Data & Analytics. Hij is bereid om je te helpen met al je vragen.