Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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 (3)
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)