Skip to main content
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: 
Not applicable

button to set date = today()

Hi - hopefully a quick one! I have a date range slider which is working nicely. I also have manual date select lists.

I'd like to put a few buttons on the dashboard saying "today", "this week", "last week", "this month", "last month" and "this year".

How is this best to do? Maybe assign a macro for each one? If so, is there any where I can research how to write the macro? I did have a go, but nothing seemed to work!!

Thanks in advance for any info

Matt.

3 Replies
nstefaniuk
Creator III
Creator III

Hi,

create a button.

Add an action "Set Variable". Name the variable vToday and add the following code :

=Today(2)

You should do the same with a trigger On Open, to be sure the variable is setted when you open the document.

Not applicable
Author

Hi Matt,

Have attached a QVD with the expressions you were looking for. Will be completely honest I've never done this before so my method is probably crude. It does rely on you having a calendar in place with the different dimensions that you want to measure. Let me know if this is what you were looking for.

Cheers,
Byron

Not applicable
Author

Hi,

Maybe also

today:

  1. create a button
  2. select in field
  3. = today()

In order to select a whole week, I think you need to create extra fields in your table. Like weekstart(yourdate) to get all the dates belonging to 1 week.

  1. create a button
  2. select in field (your  new weekstart field)
  3. = weekstart(today())