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

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

Variables not being set

Good Day,

I have an interresting occurence with one of my models. I use input boxes (tried it with calendar sliders with same result) that use variables (to get a Date Range from a loaded field). Everyhting works fine, except that I have to click on a list box - that contains the loaded date field (or funny enough - the clear selections button) after making selections before the changes takes place.  I suspect it has something to do with the Triggers - I have tried to use Select Object in my variable change - as well as Clear All Selections (to automate the "manual workaround") with no avail. Does anyone perhaps have an idea to set me in the right direction please?

2 Replies
Not applicable
Author

I have sorted it out. In triggers I added an on change event for my variables vStartDate and vEndDate. The Subroutine looks like this:

Sub SelectDates

vClick_Begin_Date = ActiveDocument.Variables("vStartDate").GetContent.String
vClick_End_Date = ActiveDocument.Variables("vEndDate").GetContent.String

if vClick_End_Date<vClick_Begin_Date then
vClick_End_Date=vClick_Begin_Date
set v = ActiveDocument.GetVariable("vEndDate")
v.SetContent vClick_End_Date,true
end if

ActiveDocument.Fields("Date").Select ">="&(vClick_Begin_Date)&"<="&(vClick_End_Date)
end sub

Not applicable
Author

It just dawned on me. I think what might have actually really solved the problem was In the Security tab under Document properties I have chosen "Macro overrides security"