SubField() Function in QlikView Application: Part 2

This article provides an introduction to the subfield function in QlikView using a variable.

In my previous article I described Subfield function in QlikView : Part 1 using table field number. The Subfield function is the most loving feature of QlikView because it avoids duplicate records.

The following is the basic procedure for using the Subfield function using variables.

Step 1: Open QlikView application

In the first step you need to open the QlikView application then go to File-> New, then this window will be opened.

After clicking New option

Step 2: Defines a variable

The second step is to define a variable. Then go to Settings -> Variable Overview.

variable

Step 3: Add a variable

Then this window will be opened. Here you need to define a new variable then click on the Add button.

name

Step 4: Define a variable name

When we click on the add button, then this box will be opened. Here you need to define a new variable name and click on the Ok button.

add

Here, I defined a variable name like that vVariable.

Step 5: Provide definition to variable

The next step is to provide a definition to the variable. Then select the variable and provide a definition then click on the Ok button.

definition

Here, I provided a default definition.

Step 6: Add a text object

The next step is to add a text object for showing the subfield function. Then go to Layout -> New Sheet Object -> Text Object.

text

Step 7: Define Subfield function

When we select the text object then this window will be opened. Now here we need to define a subfield function.

subfield

Here you can see I use Variable name (vVariable) that I declared in the variables.

Now you will see this result.

main

Note: In the Subfield Function parameter I defined field_no(3) then this function extracts field_no(3) from the variable definition.

Step 8: Go to the properties of the text object

The next step is go to the properties of the text object and define another field_no.

property

Now here define a Subfield function. If I change field_no then see what can happen?

function

Now you will see this result.

main1

Summary

This article provided an introduction to the subfield function in QlikView using a variable.

Previous article: SubField() Function in QlikView Application: Part 1