Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pal25
Contributor III
Contributor III

How to add an input parameter in Qlik (like Tableau has this feature)

Hi, 

I have a map with countries mapped on it. i have following requirements which shall change the color of the countries on the map -

1. Create a string parameter which shall have couple of questions such as ( which have to be single select)

q. Country size above selected value ?

b. Country population above selected value?

2. Creating a Integer parameter for user input 

For each of the question above (a & b), i want to put a parameter box where user can input a value and the color of the countries will change based on the value considering yes / no based on the condition.

This is possible in tableau, can some one help and guide how this can be achieved in Qlik ?

 

 

 

1 Solution

Accepted Solutions
tm_burgers
Creator III
Creator III

Pal, 

 

in that variable window you have open :

 

variable name : vQuestion_Select

definition: 0

 

and add the 2nd

variable name : vParameter_Input

definition: 0

 

Then on the sheet; add the "Variable Input" object twice. one will be tied to the  vQuestion_Select and the other is vParameter_Input

 

You don't actually have to load the questions in the script. 

 

For the  vQuestion_Select dropdown variable input, add Fixed Values,  

Value = 0

Label = 'Select Map Coloring factor....'

 

Value = 1

Label = 'Country size... 

 

Value = 2

Label = 'Country population...

 

 

 

 

View solution in original post

6 Replies
tm_burgers
Creator III
Creator III

Yes, it can be done. 

 

Create a Variable Input for each of the questions. 

 

Then in your color expression something like;

if([CountrySize]>$(vInput_CountrySize),blue(),grey())

 

pal25
Contributor III
Contributor III
Author

Hi @tm_burgers , thanks for your response

Your solution works when we have one question. How do i deal when i have multiple questions (like a & b in the above example). 

My requirement is that user should first choose the question -> then input the value in the respective variable input ->  then the color in the map should change accordingly based on the question selected and input values

Because color in the map can change only based on the one question at a time.

How can this be achieved ?

 

tm_burgers
Creator III
Creator III

Load your questions in the app as a table. 

 

LOAD * INLINE [
Qnum,Question
0,Select Map Coloring factor...
1,Country size above selected value?
2,Country population above selected value?
];

 

Add a variable vQuestion_Select & vParameter_Input

Add two Variable Input tiles.

1 - Dropdown box - vQuestion_Select

Values 0,1,2

Labels concat( {1< Qnum = {'0'} >} Question); etc.   <or you can skip the inline table and just add here as text, depends how often you may want to change>

 

2 - Input Box - vParameter_input

 

Color Expression:

 

if($(vQuestion_Select)=1 and AGGR(Sum( [CountrySize] ),Country)>$(vParameter_Input),blue(),
if($(vQuestion_Select)=2 and AGGR(Sum( [CountryPopulation] ),Country)<$(vParameter_Input),red(),black(50)))

 

 

 

 

 

 

 

 

 

 

 

 

pal25
Contributor III
Contributor III
Author

hi @tm_burgers ..thanks again for the response.

As i am new to Qlik, can you please tell me how to load the questions in a app as the table ? 

I currently using a flat file for in my app and when i go to data load editor, its locked. 

Is there any other way to load questions ?

Also , while creating 1st  input variable which is  Dropdown box - vQuestion_Select, where to put the value and labels. When i click on creating the variable, the below window appears for me

pal25_0-1655922165336.png

 

And are we creating one input box for both the questions ?

Really appreciate for your support  

 

 

tm_burgers
Creator III
Creator III

Pal, 

 

in that variable window you have open :

 

variable name : vQuestion_Select

definition: 0

 

and add the 2nd

variable name : vParameter_Input

definition: 0

 

Then on the sheet; add the "Variable Input" object twice. one will be tied to the  vQuestion_Select and the other is vParameter_Input

 

You don't actually have to load the questions in the script. 

 

For the  vQuestion_Select dropdown variable input, add Fixed Values,  

Value = 0

Label = 'Select Map Coloring factor....'

 

Value = 1

Label = 'Country size... 

 

Value = 2

Label = 'Country population...

 

 

 

 

pal25
Contributor III
Contributor III
Author

@tm_burgers , thanks soo much for your help. This works for me now with the current requirement.