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: 
Doran_Qlik
Contributor II
Contributor II

Filtering Data in a Table by Date

Hi All, 

I am very new to Qliksense and I have a table that shows:

  • Team Members
  • Activity Date
  • Activity Description
  • Activity Category
  • etc. 

I'd like to be able to add in a function to the Activity Date field so that it only shows data if the Year = 2022 (which is in the load script as I have done this for other charts). 

Can anyone advise how I do this?

Labels (2)
6 Replies
piyush_gaud
Contributor II
Contributor II

Hey @Doran_Qlik ,

Try the below function in the Activity Date field - 

=if(YEAR(Activity date=2022,Activity Date))

Doran_Qlik
Contributor II
Contributor II
Author

This still doesn't work. (I think because I have Year("Activity Date") as "Year" in my load script)

I have tried using a set analysis with the below in the Activity Date field but this isn't working either. 
=count({<Year={"2022"}>}[Activity Date])

Doran_Qlik
Contributor II
Contributor II
Author

I figured out the issue. I was trying to use the function on a dimension rather than a measure. 

I got this to work using:

=Concat({<Year={"2022"}>}[Activity Date])

Thanks!

piyush_gaud
Contributor II
Contributor II

Hey @Doran_Qlik , Why did you use concat in the expression?

Doran_Qlik
Contributor II
Contributor II
Author

Because I wanted the pivot table to show the full date value in each row rather than a sum or count and concat seemed to work 😊

vinieme12
Champion III
Champion III

Create Calendar in your data model that is associated to ActivityDate  

 

Refer the script in below article,

Simply replace "ORderDate'  with ActivityDate to associate the calendar with your dataset

https://qlikviewcookbook.com/2015/05/better-calendar-scripts/

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.