Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I assign a default value to input box so it is set on the document load

I have an input box that defines the date for analysis. It can be changed by the user to redraw the charts. How can I set the value that contains the input box on the document load to be the current date? Thanks in advance!

1 Solution

Accepted Solutions
Not applicable
Author

You mean you want the input box to show current date whenever the document is opened?

If so, then you can create a variable as suggested by Anand and write an action OnOpen of the document. Say your variable is :

vCurrent = Today()

Then write the following action,Go to Settings--Document Properties--Triggers tab, then in Document Event Triggers, add an action :

Action Type : External

Action : Set Variable

Write the variable name and the value in respective boxes.

Hope this helps!

View solution in original post

4 Replies
its_anandrjs

Use a variable like  vCurrent = Today()  and use this variable in the input box. It always show current date value and if you have to find from any field then use peek function.

Hope this helps

Thanks & Regards

Not applicable
Author

It is not convenient as I can't apply neither input constraints nor number format settings to such input box. Is there a kind of event driven solution? Like vba windows apps function for events: Onload, etc.

Not applicable
Author

You mean you want the input box to show current date whenever the document is opened?

If so, then you can create a variable as suggested by Anand and write an action OnOpen of the document. Say your variable is :

vCurrent = Today()

Then write the following action,Go to Settings--Document Properties--Triggers tab, then in Document Event Triggers, add an action :

Action Type : External

Action : Set Variable

Write the variable name and the value in respective boxes.

Hope this helps!

Not applicable
Author

That does work! Thanks a lot!