Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Actual year and month selected by default on a view of Qlikview

Hello, My name is Natacha De la Rosa, I'm from Dominican Republic and i'm beggining to develop with qlikview.

So this is my question, I have a view that is displayed by year and month, and I want to put by default selected the actual year and month. Is that posible? and if the answer is yes. How can begin with that?

1 Solution

Accepted Solutions
Not applicable
Author

I did the example with your month = MonthNames (describe in the script beginning)

1Open the script

2 add that in the script (anywhere):

let varYear =year(today());

let varMonth= Month(today());

3Save and close your script.

4Go in Settings -> Document properties -> Triggers.

5 click "On Open" in  Document Event Triggers

6 click "Add action(s)"

7  click "Selection" in Action Type and "Select in field" in action

8 Click "ok"

9 Type your year field name in Field and "=varYear" in Search String

10 click "Add action(s)"

11click "selection" in action type and "select in field" in action

12 click "ok"

13 Type your year field name in field and "=varMonth" in Search string

14 click "ok" and "ok",

15 save and close the application

16 open it.

Is it working/ For yhe year? the month?

If it's not working for the month, could you give me the format month?

View solution in original post

16 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You can set 2 Variables for the current Year and Month in the Load Script, and then create Actions to select those values in the corresponding Fields upon opening the document:

Open "Settings" - "Document Properties" - Triggers.

Find the event "OnOpen" and enter the Actions editor. In the actions, pick "Select in field" and fill out the Field name and the Value (coming from the Variable).

This might be a bit too much for a beginner...

Not applicable
Author

Hi, Nice to meet you.

Yes it's possible. If you want a static solution it's really simple. You just need to select the month and the year. Save and close your application. When you open it again, the selectin stay. Qlikview open the application with the selection saved.

Do you need a dynamic solution??

Not applicable
Author

Oleg Troyansky, thanks for answer, could you explain me a little more simple, like I write before, i'm beggining so could you help me at this point please.

EvaPOLINI, thanks for answer, I need a dynamic solution for this, What you recommend me?

Not applicable
Author

Who?

Not applicable
Author

who could guide me with this?

Not applicable
Author

Can I do this with javascript and if the answer is yes, how can I do it?

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Natacha,

you might require a bit more detailed support than this forum is built for... We usually show you the right direction...

What part of the solution do you need help with?

Setting the variables in the script:

let vCurrentYear = year(today());

let vCurrentMonth = Month(today());

I described the rest in my previous post

best,

Oleg

Not applicable
Author

I did the example with your month = MonthNames (describe in the script beginning)

1Open the script

2 add that in the script (anywhere):

let varYear =year(today());

let varMonth= Month(today());

3Save and close your script.

4Go in Settings -> Document properties -> Triggers.

5 click "On Open" in  Document Event Triggers

6 click "Add action(s)"

7  click "Selection" in Action Type and "Select in field" in action

8 Click "ok"

9 Type your year field name in Field and "=varYear" in Search String

10 click "Add action(s)"

11click "selection" in action type and "select in field" in action

12 click "ok"

13 Type your year field name in field and "=varMonth" in Search string

14 click "ok" and "ok",

15 save and close the application

16 open it.

Is it working/ For yhe year? the month?

If it's not working for the month, could you give me the format month?

Not applicable
Author

Hello, I tried the example that you give me,works with the year but the month doesn't work, the month format is numeric.