Qlik Sense Mapping and Logical Functions

Last updated on Nov 15 2021
Deepak Gupta

Table of Contents

Qlik Sense Mapping and Logical Functions

Below are some Mapping Functions in Qlik Sense –

i. ApplyMap() function
We use this function to map or mirror the output of an expression, that evaluates during script execution, during a previously loaded table.
The syntax of Qlik Sense ApplyMap() function.

1. ApplyMap(‘map_name’, expression [,default_mapping])

Where map_name is that the name of the table from which we would like to map the fields or field values into a replacement table. This table will read by mapping LOAD or Mapping SELECT statements before applying the ApplyMap function.

The expression is that piece of quote or a condition, evaluation of whose result we’d like to map.

The default_mapping may be a conditional parameter which specifies the worth that we use when the table evaluates for the expression condition, doesn’t contain a particular value. If the default mapping value isn’t set then the worth of the expression will return because it is.

Do you realize Qlik Sense Exponential and Logarithmic Functions

For instance,

1. // Load mapping table of country codes:
2. map1:
3. mapping LOAD *
4. Inline [
5. CountryCode, Country
6. Swd, Sweden
7. Dmk, Denmark
8. Nor, Norway
9. ] ;
10. LOAD *,
11. ApplyMap( ‘map1’, CountryCode ) As Country
12. Inline [
13. CountryCode, Salesperson
14. Swd, John
15. Swd, Mary
16. Swd, Parker
17. Dmk, Josh
18. Dmk, Olivia
19. Nor, Emma
20. Nor, Fred
21. ] ;
22. // we do not need the CountryCode anymore
23. Drop Field ‘CountryCode’;

The resulting table is given below, where, using the ApplyMap() function the Country field is mapped using the CountryCode field within the expression.

Salesperson Country

John Sweden
Mary Sweden
Parker Sweden
Josh Denmark
Olivia Denmark
Emma Norway
Fred Norway

ii. MapSubstring() function

The MapSubstring() function maps a substring or a neighborhood of a knowledge field from a previously loaded data table (using mapping LOAD/SELECT statements) to a different table. This function is case-sensitive and returns a string type data value.

The syntax of Qlik Sense MapSubstring() function:

1. MapSubstring(‘map_name’, expression)

Where map_name is that the name of previously loaded table using the mapping LOAD/SELECT statement.
Expression is that statement whose result’s to be mapped as substrings on the new table.

For example, first load a table named ‘attributes’ having two fields, AttributeCode and therefore the Attribute to which each code corresponds. Then within the next table, we’ll load a table named ‘Productmodels’ during which we’ll use the values of attribute table by applying MapSubstring function into the Productmodels table. within the resultant table, all the attribute names are loaded within the Description table by just mapping the AttributeCode substring within the Productmodels function.

Let’s revise Qlik Sense Color Functions

1. attributes:
2. mapping LOAD *
3. Inline [
4. AttributeCode, Attribute
5. R, Red
6. Y, Yellow
7. B, Blue
8. C, Cotton
9. P, Polyester
10. S, Small
11. M, Medium
12. L, Large
13. ] ;
14. Productmodels:
15. LOAD *,
16. MapSubString(‘attributes’, AttributeCode) as Description
17. Inline [
18. Model, AttributeCode
19. Twixie, R C S
20. Boomer, B P L
21. Raven, Y P M
22. Seedling, R C L
23. SeedlingPlus, R C L with hood
24. Younger, B C with patch
25. MultiStripe, R Y B C S/M/L
26. ] ;
27. // we do not need the AttributeCode anymore
28. Drop Field ‘AttributeCode’;

Below, is that the resultant table. Here, with the assistance of MapSubstring function, the respective attributes of the given models are mapped within the field Description using AttributeCode field values.

Model Description
Twixie Red Cotton Small
Boomer Blue Polyester Large
Raven Yellow Polyester Medium
Seedling Red Cotton Large
SeedlingPlus Red Cotton Large with hood
Younger Blue Cotton with patch
MutliStripe Red Yellow Blue Cotton Small/Medium/Large

Qlik Sense Logical Functions

There are two important logical functions in Qlik Sense IsNum and IsText, which we use both in Qlik Sense chart and script. Basically, these functions sort from a knowledge table, values that are the string and people which are numeric.

Have a glance at Qlik Sense Null Functions

As they’re logical functions, so if a knowledge value encountered within the script is numeric like 55, then the expression IsNum() will evaluate to be True and -1 will return as a result. But, if the worth isn’t numeric, say, ‘Apple’ then the IsNum() function will evaluate to False and return 0 as a result to the user.

The same occurs within the case of the IsText function, where it returns True or -1 when a text or string value is encountered and False or 0 when a text or string value isn’t encountered. So, these Qlik Sense Logical Functions use when the user is handling tons of knowledge records and values and wish to sort and manage them properly supported the sort of their format

i. IsNum
The IsNum() function looks for a numeric value while a script is executed and returns -1 if it encounters a numeric value and 0 when it doesn’t encounter a numeric value.

The syntax for Qlik Sense IsNum:

1. IsNum(expression)

Let us understand this with the assistance of an example, where we load some data values inline and use IsNum() function to sort numeric values from it.

Do you realize Qlik Sense Mapping Functions

1. Load *, IsNum(Entries)
2. Inline [
3. Entries
4. 23
5. Mike
6. Robert
7. 40
8. 55
9. Angela];

This will create two fields or columns during a resultant table, which is ‘IsNum(Value)’ and ‘Entries’ where -1 and 0 will show True or False for a worth being numeric in nature or not respectively.
Entries IsNum(Entries)

23 -1
Mike 0
Robert 0
40 -1
55 -1
Angela 0

ii. IsText
We use the IsText() function to guage a script for text or string values. even as the IsNum function returns -1 and 0 when it finds or doesn’t find any numeric value respectively, the IsText function does for the text value.
Let’s revise Qlik Sense Color Functions

The syntax for Qlik Sense IsText:

1. IsText(expression)
For instance, if we load an equivalent data inline as we did within the example above and apply IsText() function thereon , then the resultant table would be,

1. Load *, IsText(Entries)
2. Inline [
3. Entries
4. 23
5. Mike
6. Robert
7. 40
8. 55
9. Angela];

Here. The resultant table will have two fields or columns, Entries and IsText(Entries) where -1 shows yes, the corresponding value may be a text or string and a 0 represents negative for encountering a string value.
Entries IsText(Entries)

23 0
Mike -1
Robert -1
40 0
55 0
Angela -1

So, this brings us to the end of blog. This Tecklearn ‘Qlik Sense Mapping and Logical Functions’ blog helps you with commonly asked questions if you are looking out for a job in Qlik Sense BI. If you wish to learn Qlik Sense and build a career in Business Intelligence domain, then check out our interactive, Qlik Sense Certification Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Qlik Sense Certification Training

Qlik Sense Certification Training

About the Course

Qlik Sense is a revolutionary Business Analytics tool to come from the Qlik stables. It provides powerful self-service analytics that are readily deployable through interactive and personalized dashboards, data visualization techniques and insightful reports. By the end of this Qlik Sense online training, you will be able to perform key skills of the self-service BI tool – Qlik Sense, such as self-service analytics, write data load scripts, data discovery, create dashboards, develop and share apps, create reports, and design and build data visualizations. All these skills will enable you to clear the Qlik Sense certification exam.

Why should you take Qlik Sense Training?

• The average annual pay for a Qlik Sense Professional is $101,871. -Indeed.com.
• HSBC, Alstom, Chrysler, Citibank, Accenture and many other MNC’s worldwide use Qlik Sense BI and it has a market share of around 5% globally.
• By the end of 2020, the market is expected to touch USD 22.8 billion as modern BI and analytics continue to expand more rapidly, Gartner said in a report.

What you will Learn in this Course?

Introduction and Installation of Qlik Sense

• Need for self-service Business Intelligence/Business Analytics
• Installation of Qlik Sense and Qlik Sense Desktop

Qlik Sense Features

• Qlik Data indexing engine
• Data dimensions relationships
• Types of Data Loading
• Types of Concatenation

Data Modelling

• Qlik Sense data architecture
• Understanding QVD layer
• Converting QlikView files to Qlik Sense files
• Incremental Load
• Scripting
• Create Master Calendar

Advance Data Modelling

• Qualify and unqualify
• Joins
• Keep
• Cross Table
• Let Vs Set
• Calendar Table Creation

Qlik Sense Enterprise

• Various Functions
• Create QVD Files
• Read Data for QVD Files
• Create QVD’s
• Create Tier 2 Qlik Sense App

Data Visualization

• Expressions
• Variables
• Extensions
• Data Visualization

Set Analysis

• Set analysis in Qlik Sense
• Use set expression like identifiers, operators, modifiers and comparative analysis

Advance Set Analysis

• Deploy comparison sets and perform point-in-time analysis

Qlik Sense Storytelling

• Storytelling feature of Qlik Sense
• Create a story and playback the story

Qlik Sense Visualization

• Qlik Sense Charts
• Advanced Charts
• Creating Dashboards
• Real Life Examples

Security

• Security aspects of Qlik Sense
• Security rules

Got a question for us? Please mention it in the comments section and we will get back to you.

0 responses on "Qlik Sense Mapping and Logical Functions"

Leave a Message

Your email address will not be published. Required fields are marked *