Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Nolgath
Creator
Creator

Variable Button for filtering tables how?

I have a table with some fields like 'dealer' 'fueltype' and other details. I also have a field that is called 'Days Online' which is a column called 'daysOnline'.

 

I have also made a variable that is 'v30days' with definition 'daysOnline'.

I have created a button variable and chose 'v30days' variable. and the value i put =daysOnline <= 30.

 

In the dimension of daysOnline i am not sure what to put there. 

 

I tried if statmenet but no success.. like :

if(daysOnline = $(v30days), daysOnline, null())

any tips?

Labels (4)
1 Solution

Accepted Solutions
Oliver_F
Partner - Creator III
Partner - Creator III

hi,

you variable should be <=30 and not =dayOnline <=30.

 

then you can use it in your expression like this:

if(daysOnline $(v30days), daysOnline, null())

 

if you always use <= you can make it even better by just storing 30 into your variable and make your expression like this:

if(daysOnline <= $(v30days), daysOnline, null())

or maybe even like this: 

if(daysOnline <= v30days, daysOnline, null())

 

But while your variable is called v30days it will always be 30 so there is no need to us a variable it all. You probably want a variable that can have different value so you should probably call it v_DaysOnline and assign it different values or even use a variable dropdown.

 

 

View solution in original post

1 Reply
Oliver_F
Partner - Creator III
Partner - Creator III

hi,

you variable should be <=30 and not =dayOnline <=30.

 

then you can use it in your expression like this:

if(daysOnline $(v30days), daysOnline, null())

 

if you always use <= you can make it even better by just storing 30 into your variable and make your expression like this:

if(daysOnline <= $(v30days), daysOnline, null())

or maybe even like this: 

if(daysOnline <= v30days, daysOnline, null())

 

But while your variable is called v30days it will always be 30 so there is no need to us a variable it all. You probably want a variable that can have different value so you should probably call it v_DaysOnline and assign it different values or even use a variable dropdown.