What are most common uses of variable in qlikview google docs

Page 1

What are most Common Uses of variable in QlikView Variables are the mainstay of data visualization softwares like QlikView Training, D3.js etc. Optimizing the use of variables always reduces application development time. Let’s look at the some common uses of variables: 1. Portability: Variables are used when we want to store values and use them in multiple objects / charts without wanting to type those values again. Variables are also used when we want to perform dynamic calculations. For example: A variable created for representing previous year as “vPrevYr=$(=Max (Year)-1)”, refers to a dynamic calculation as per current selection and can be accessed by all objects of the document.

2. Use in Chart Objects: We can make use of variables in charts at multiple places using: ○ Dynamically limit the dimension: I answered a related question on discussion portal regarding functionality of charts in QlikView Data Transformation. I solved it by creating a variable to hold the input of user (how many categories, he / she wants to see) using input box and then used this variable in dimension limit tab of the chart. You can see the complete solution here.


Conditional enable or disable dimension / expression / object: Think of a scenario where you have segregated your charts objects in two categories. Then, you want to show only one category at a time. This can effortlessly be done using button or variable. Let’s follow the below steps to perform this: ■ Step 1: Create a variable “vVisible” and assign the value as zero (0). ■ Step 2: Create a Button then go to properties –> Action –> Action Type (Expernal) –> Action (Set Variable) ■ Step 3: Assign the value to variable as zero (0) and provide the name to variable as “Category1”. Similarly create another variable as “Category2” and assign the variable (vVisible) value as 1. ■ Step 4: Select the chart objects and go to properties –> Layout –> Conditional.Based on which category this chart belongs, apply the condition for variable “vVisible“. Repeat this process for all chart objects those you want to enable or disable based on category.


Step 5: Now click on any Category button, it will show charts related to that category only. 1. What-if analysis: We can use variable in what if analysis expression also using “Input Box” or “Slider Object”. In such cases, we take value of variable from these objects (Input, Slider) and used them in expression. 2. In expressions (Set Analysis and Aggr): You can use variable in advance expression like Set Analysis, Aggr() and others. For more detail of these expression you can follow these articles (Set Analysis, AGGR())


Apart from the uses mentioned above, we can also use variable for incremental data load and in various scripting methodology to improve our data models.

End Notes: In this article, we looked at the importance of variables, methods to create it and the common uses of variable in daily development. Basically, we have looked at two methods (Set & Let and Variable Overview) to create them. If I summarize the most common use of variable, then it would be expression development using other charts objects like Input box, Slider, Text Box, Buttons and others. My advise to you would be using the variable in your dashboard. It reduces the static nature of dashboard and can change the value across the expression by changing it at one place only.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.