Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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.

Tags (3)
3 Replies
nstefaniuk
Contributor III

Re: button to set date = today()

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

Re: button to set date = today()

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

button to set date = today()

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())
Community Browser