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: 
felix18807
Contributor III
Contributor III

Select two dynamic date ranges with a button

Is there any way of getting a date range selected using a button for the filter below?

 

Basically I want to be able to dynamically select from April this year to today AND from April last year to 1 year ago today.

='(>=$(=yearstart(addyears(today(),-1),0,4)) ' &
'<$(=addyears(today(),-1))) AND ' &
'(>=$(=yearstart(today(),0,4)) ' &
'<$(=today()))'

Many Thanks

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan
MVP
MVP

HI

Try like this

='((>=$(=yearstart(today(),0,4)) ' & '<$(=today()))' & '*|*' &'(>=$(=yearstart(addyears(today(),-1),0,4)) ' &'<$(=addyears(today(),-1))))'

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan
MVP
MVP

HI

Try like this

='((>=$(=yearstart(today(),0,4)) ' & '<$(=today()))' & '*|*' &'(>=$(=yearstart(addyears(today(),-1),0,4)) ' &'<$(=addyears(today(),-1))))'

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
felix18807
Contributor III
Contributor III
Author

Ahh it was the | character that I was missing! TYVM