Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
sanchi21491
Contributor II
Contributor II

Using Variable in Filter Pane in Qlik Sense

Hello Qlikers,

I am facing challenges while using a variable in the Filter Pane of Qlik Sense. I wish to filter my dimensional values like Country, Address by Time(All Months|Previous Month), for which I created a Variable $(vTimePeriod).

How can I use this variable to filter my dimensional values in filter pane? Any ideas are appreciated!

Thanks!

Labels (1)
1 Solution

Accepted Solutions
Kush
MVP
MVP

This will depend on the definition of what you have calculated in variable $(vTimePeriod)

Suppose you have calculated "max(Year)" in that variable, which gives value as "2019" then you can use this variable to filter any dimension in filter pane

for eg. you can use variable to filter product dimension like below

= aggr(only({<Year = {"$(vTimePeriod)"}>}Product),Product)

View solution in original post

9 Replies
Anil_Babu_Samineni

What is the definition of that variable? 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Kush
MVP
MVP

This will depend on the definition of what you have calculated in variable $(vTimePeriod)

Suppose you have calculated "max(Year)" in that variable, which gives value as "2019" then you can use this variable to filter any dimension in filter pane

for eg. you can use variable to filter product dimension like below

= aggr(only({<Year = {"$(vTimePeriod)"}>}Product),Product)

View solution in original post

sanchi21491
Contributor II
Contributor II
Author

Thanks a lot! It solved my issue! Grateful

sanchi21491
Contributor II
Contributor II
Author

Hi Kush,

I'm using Qlik Variable Extension in my application and used the above expression in the filter pane for dimensions. However, I am not able to select multiple values at a time. 

Is there a solution for this scenario?

Thanks! 

 

 

abhirup99
Contributor II
Contributor II

Hi Kush,

We can't select multiple countries in the filter pane when using the aggr function?Is there any solution to tackle such problems? Your solutions will be highly appreciated

I am illustrating the situation below

When I try open the '"Country" filter first time, though it shows multiple values. But it allows only one selection.

It allows multiple selection that too from the filter navigation at the top and after I have done my initial selection of one value from the filter pane.

Test img_2.JPG

 
 
 

 

 

 

 

 

 


But when I select IND, it doesn't allow multiple selection provision thereafter.

 

Test img.JPG

 

 

 

 

Also attaching the qvf for reference.

kalyanamharish
Contributor III
Contributor III

My observation is we can select multiple values by selecting any one value in the list and dragging down however, we are unable to use the SHIFT key to select the random values.

Kush
MVP
MVP

Use it like below

aggr(only({1<Year = {"$(vTimePeriod)"}>}Product),Product)

kalyanamharish
Contributor III
Contributor III

Hi @Kush 

Why $ is not working in the place of 1 ?

I mean i was thinking by keeping $ (Set identifier ) in front of Year would allow me to Select multiple Years from the Dimension Filter pane.

 
As per understanding $ should respect the current selection i.e value of expression changes based on the current selection made in UI and 1 will not change the value of that particular expression even if we make any selection in the UI

Kush
MVP
MVP

if you use $, aggr expression evaluates the associated value and removes the excluded values from filter. But if you use 1 then aggr function works as normal filter. So identifier '1'  does the trick here in filter pane