Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select Current Month OnOpen

Hi all,

I have a listbox "MonthInNumer", which shows me the months from January to December in Numbers (1-12).

I created the field with the following:

month(date(DateID,'MM')) as MonthInNumber,

Now I want to select automatically the current Month in this field when opening or reloading the document.

Is there a way to achive this with macro or another way?

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

look at my solution. I tested it, as mentioned above, first with my button.

RR

View solution in original post

10 Replies
Not applicable
Author

Hi,

You can use the sheet event triggers to achieve this. use monthinnumber field with max(monthinnumber) in select in field option.

Every time you would open a sheet, the selection will be automatically triggered.

Not applicable
Author

Hello, thank you for your answer but it didn't work for me.
QlikView doesn't select anything when opening.
I tried using Document triggers before, but I think, QlikView cant match the "Month"-Syntax with my Numbers from my Table (1-12).

Any other solutions on this?
Thanks in advance!

Not applicable
Author

Hi,

Use this expression =Date(today(),'MM'). It should give you the month as 11 which you can use to match with your field.

Not applicable
Author

Still nothing 😞
I have the feeling, that QlikView is showing a Month between 1-12, My field MonthInNumber contains (Jan-Dec), with the fact, that I did override the Document Settings as Number.

So, it still don't match the current date with my field.
Can anyone provide me an example how to match the current month with an table, that contains month from Jan-Dec or from 1-12?

Thanks for help.

Not applicable
Author

Hi,

why don't you proof your (action-)expression with a button? A new empty sheet with two objects: the button with your selection-action and a simple listbox to see what is happening. If your trigger works as expected, it should behave the same way on opening.

Regards Roland

P.S.: If you therefor need help, send a little sample.

Not applicable
Author

Could you upload your application?

Not applicable
Author

Ideally you need to consider the whole date, else you could end up selecting '11' for 2008, 2009 and 2010 (depending on your data set).

You can still use the same 'select in field' idea to select the maximum date. To add to the previous post, please provide a sample if you can then we can help even more.

Not applicable
Author

Hello all,

thank you very much for your help in this case.
Here's the link, where you can download the .zip file for my application with the Excel Table:
http://www.2shared.com/file/931yrhg0/Forum.html

What I want to achive is, that when I'm opening or reloading the document, only the actual month (i.e. November) is showing up.

As you can see in my application, I tried it with the Document trigger and I created a Macro Module.
Please have a look at it, maybe anyone can find a solution.

Thanks again!

EDIT: For downloading simply click on "Save file to your PC" on the right bottom on the page. Its a little bit hard to find ... but its a good hoster ...
Thank...

Not applicable
Author

Hi,

look at my solution. I tested it, as mentioned above, first with my button.

RR