Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
gcislo
Partner - Contributor II
Partner - Contributor II

Filter a table based on variable

I have a table with a field startTime which shows the date and time of an entry. I also have a user variable filterDate. I want to give the user the option to either show the full table or all the entries on or after that filterDate. I am open to both filter expressions for chart options. Thank you!

Labels (4)
2 Replies
pravinboniface
Creator II
Creator II

I would use a toggle button to let the user switch between 'Full Table' and 'Filtered Table'

You can apply your Date filter (vFilterDate here) to select accordingly.  Since the date is a dimension, uncheck 'Include null values'

// vButton is a variable attached to a button to show full  table or filtered table
=if ( $(vButton)= 'Filtered Table',
   // Filter button selected
	if (TempDate>=$(vFilterDate),date(TempDate),Null()),
    // Full table
    date(TempDate)
    )

 

gcislo
Partner - Contributor II
Partner - Contributor II
Author

Thank you! I will give it a try.