Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
MCmiranda
Contributor II
Contributor II

Button for YearToDate selection

Hello smarties,

I want to make a button for the selection of the last 12 months and a selection of the last month.

I find a variety of functions, but don't know which one to use.. Anybody can set me up with this?

 

I've set Action:

Select value in a field -> field -> name is 'Date Check' 
Now I have to put in a value.. To get the last 12 months from today.

 

 

Labels (2)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try this:

=Concat({1<[Date Check]={"<$(=Today())>$(=AddMonths(Today(),-12))"}>} [Date Check],';')

View solution in original post

4 Replies
GaryGiles
Specialist
Specialist

Try this:

=Concat({1<[Date Check]={"<$(=Today())>$(=AddMonths(Today(),-12))"}>} [Date Check],';')

QFabian
Specialist III
Specialist III

>=addmonths(yourdate, -12) <= yourdate

QFabian
MCmiranda
Contributor II
Contributor II
Author

Thank you, this is awesome!

MCmiranda
Contributor II
Contributor II
Author

Hi Gary,

I believed I could figure the code for the selection of this month myself, for the other button.. But I can't

I tried:

=Month(Today())

=AddMonths(Today(),1)