Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Calendar Value On Open

Hi folks,

Wonder if anyone has any ideas how to do this. I've looked around on here but none of the suggestions seem to have worked.

  • Have got a SQL view which returns a date value based on some logic.
  • I have  a calendar object in Qlikview which I want to display this value when the document is first opened.
  • The calendar object uses a variable in the 'variables' section. i.e. when a value is chosen on the calendar, that variable value then changes to the same value.


Can anyone tell me how to set this up so that when the document is first opened, it takes the value from the SQL view and displays it in the calendar object?

I have tried to set this using Settings - Document Properties - Triggers - Document Event Triggers - OnOpen:
I've then set the 'Field' to the =vVariable and the 'Search String' to = SQLColumn

However this is not working when I close and re-open the document. I'm wondering if I'm doing this wrong and shouldn't be setting the variable value (as this is set by whatever value the user selects in the calendar object).

Thanks in advance.

5 Replies
johanlindell
Partner - Creator II
Partner - Creator II

You can put it in the load script. Something like

MyView:

SQL SELECT MyDate FROM MyView;

LET vVariable = Peek ('MyDate', 0, 'MyView');

This will assign the variable everytime you reload the document.

//Johan

Not applicable
Author

Thanks so much Johan,

Do you know if there is anyway to get this to happen when you open up the document, as opposed to only when the reload script is run?

Many thanks though anyway. This has worked when reloading script, but would be great if I can get it to work when user re-opens doc as well.

johanlindell
Partner - Creator II
Partner - Creator II

Did you get the syntax right?

See attached. Works in my local installaion.

Anonymous
Not applicable
Author

Hi Johan,

I think I have a similar problem and hoping you can help.

Refer here:

Re: Replace input box with calendar object (on reload script)

Ultimately I want a date picker associated with my SQL parameters so that on reload the date picker pops up and the user, instead of typing into a free text field input box, rather selects a date from a calendar. Any ideas?

johanlindell
Partner - Creator II
Partner - Creator II

Hi,

Have you tried the "Slider/Calender" object? This you can link to either a variable or a field (and set a min / max). Below an example linked to a variable, but as you see, you can link it to a field also.

Johan

2018-02-15 13_00_48-MediTech (medqv01.medevo.local) - Remote Desktop Connection Manager v2.7.png

2018-02-15 13_01_19-MediTech (medqv01.medevo.local) - Remote Desktop Connection Manager v2.7.png