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

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

macro to select value

Hi All,

When I load my data I create max year, month & day fields and the qvw has a calendar where the user can select date ranges.

I have a button that puts a selection on the year, month and day objects to select the data for the previous day, as that's the most popular selection.

The button works great on my local PC but on the server stops working after data is reloaded - it selects the max year & month but can't do the day.

On the server if the QlikView process is stopped and restarted the button works!

The code for the macro is simple:


set thisyr = activedocument.Variables("vRepYear")
set thismth = activedocument.Variables("vRepMonth")
set thisday = activedocument.Variables("vRepDay")

ActiveDocument.Fields("Report Year").Select thisyr.GetContent.String
ActiveDocument.Fields("Report Month").Select thismth.GetContent.String
ActiveDocument.Fields("Report Day").Select thisday.GetContent.String

I've used variables, and assign the MaxYear, MaxMonth & MaxDay values to them, then use the variable values in the macro to make the selections.

Is there a better way of doing this that might get round the problem where the macro doesn't work on the server?

Many thanks,

Phil

1 Reply
Not applicable
Author

Which Qlikview version are you using?

With version 10 , you can use the actions instead of a macro to do it.

It works better and faster than a macro.

Hope that helps.

Philippe