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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Database Selection on Model Open?

Hi

We are in the fruit industry and have recently started using our 2011 database from a pallet tracking system.

This makes it kind of difficult to switch between 2010 and 2011 data in Qlikview.

Now i have my 2 load scripts running in the background collecting data from both databasis and storing it as QVD's with 2010 or 2011 in the file name.

I have one model that have all my reports etc tho which loads the QVD files that i have specified.

Is it possible to have a 2010 or 2011 popup when the user open the document and based on that selection the model will load the 2010 or 2011 QVD's automatically?

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

This script will do:

LET vYear = Input('Input year', 'Warning!');

Data:LOAD *

FROM File$(vYear).qvd (qvd); // provided the file is File2010.qvd

Hope this helps.

View solution in original post

16 Replies
suniljain
Master
Master

you mean, you want to load data according to user selection. i.e 2010 or 2011

Am I right ?.

Miguel_Angel_Baeyens

This script will do:

LET vYear = Input('Input year', 'Warning!');

Data:LOAD *

FROM File$(vYear).qvd (qvd); // provided the file is File2010.qvd

Hope this helps.

Not applicable
Author

yes, my load scripts already load and store the 2010 and 2011 QVD files seperately, but i dont want to use 2 different models to view the data, my one model is like a template to with all the reports, i just want a "switch" to select which set of QVD files to load

suniljain
Master
Master

pls check in shared document , someone alredy posted application for this types of requirement.

deepakk
Partner - Specialist III
Partner - Specialist III

hi Ruan,

I would recommend you to make it simpler by loading both the data into the application.

Provide a filter of Year to user so that user can change the year on their will.

YOu can by default select the Year 2011 on the open Event of the application hence when ever the user opens the application he will be able to see the 2011 data and will have the option to change it to 2010 uisng the filters

suniljain
Master
Master

suggestion given deepak direclt affect the performance at design level. to give fileter based on year takes lots of time to display content after selection.

suniljain
Master
Master

The solution given by Miguel is perfect

Not applicable
Author

Thanx this will do, just tested it on a model and it will give me the desired "selection".

Now how do i use it as a trigger when a user open the document with Access Point?

Not applicable
Author

From what i could find is i need to use the OnOpen trigger and write a macro for it to ask the Year correct? Can somebody please help with Miguel's code in the macro?