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...
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?
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
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??
Also just started developing in QlikView. Following the above I have set a variable of current financial yesr as the selection on opening. I presume that with a variable for the previous financial year I should be able to open with both previous and current year selected. What statement would I need in the search string to combine the two variables.
Thanks for any help.
That is correct. I have established how a variable can be set in the trigger but I want to open the app with two variables, CY and PY, active.
tel: 01206 746530