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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
1600eads
Contributor III
Contributor III

Dynamic filter to open app with max yearmonth

I am having trouble setting up a dynamic filter so that a user will see the current month and year data when opening an app.

I followed Christoph video here - https://www.youtube.com/watch?v=tFyqOigqnUw

Also formatted by date using this expression in the script - 

(Date(monthstart(DATE_TEST), 'MMM-YYYY')) as NEW_DATE which looks like the img below.

1600eads_0-1719602695753.png

Now directly within the search bar I am trying to grab the max/latest year month value which should be Jul-2020 using this expression.

=NEW_DATE=Monthstart(now())

This does nothing and unable to yield the Jul-2020 value I expected. Can anyone provide some feedback here? Thank you!

 

 

 

Labels (2)
1 Solution

Accepted Solutions
1600eads
Contributor III
Contributor III
Author

I was unable to mimic what Christoph did in his video using month(monthstart(today())) but found this thread and was able to use that expression and working as expected. I also want to note that I did this in the selection tool directly instead of on the sheet.

Here is the thread- https://community.qlik.com/t5/New-to-Qlik-Analytics/Dynamic-default-bookmarks/td-p/1805017

View solution in original post

5 Replies
rubenmarin
MVP
MVP

Hi, now() will return today date, wich will be Jun-2024 and that value didn't exists, you can try with Max(), and also adding the date format, like: =NEW_DATE=Date(Max(DATE_TEST), 'MMM-YYYY')

First you can try to set this expression (=Date(Max(DATE_TEST), 'MMM-YYYY')) in a simple table to confirm that it returns the value you want to be selected.

1600eads
Contributor III
Contributor III
Author

Still not yielding anything on my end. If I wanted it to return the current month and year - so July-2024, shouldnt the below expression work?

=NEW_DATE= month(monthstart(today()))

Much thanks Rubenmarin.

1600eads
Contributor III
Contributor III
Author

I was unable to mimic what Christoph did in his video using month(monthstart(today())) but found this thread and was able to use that expression and working as expected. I also want to note that I did this in the selection tool directly instead of on the sheet.

Here is the thread- https://community.qlik.com/t5/New-to-Qlik-Analytics/Dynamic-default-bookmarks/td-p/1805017

1600eads
Contributor III
Contributor III
Author

If I wanted to grab the last 14 days any idea how to go about that?

I tried NEW_DATE=today()-14 and NEW_DATE=date(today())-14 but no luck there.

rubenmarin
MVP
MVP

Try setting the -14 inside the date, if you set outside it will end with number format instead of date:

NEW_DATE=date(today()-14)