Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

load script - prompt user for data file name to reload from

hi is there a way to prompt the user (by input box) each time a reload is required for the file name for which the data is to be loaded from?

The excel data file name changes on a monthly basis and therefore it isnt the user friendly option to manually add the path to the load script each time.

e.g. my script currently looks like the following

---------------------

[DEMAND DATA]:
LOAD Month,
CAL_DAYS,
Start_Date,
Real_Data
FROM
[\\C:\Program Files\QlikView\Data\Demand Model Version 10.xls]
(biff, embedded labels, table is [Qlikview Output$]);

--------------------------

Say if the excel data file has changed to 'Demand Model Version 15.xls'. Would it be possible to include a user input box that prompts the user to enter this new name on reload? This file name can then be used to update the load script file path.

Any ideas??

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

Use dollar expansion

FROM [$(vDemandModelPath)](biff, embedded labels, table is [Qlikview Output$]);


Besides, is my custome to enclose in square brackets when spaces or blanks are likely.

View solution in original post

6 Replies
Not applicable
Author

Hi J Trof,

We can do this with help of macro (VBscript). Write a macro to get a input from user and store that to a variable, You can use this variable in your load script.

B/w after writing the macro, map the fucntion to BEFORE RELOAD event in document settings so that it will popup the input box for the user to enter the file path and name.

- Sridhar

Miguel_Angel_Baeyens

Hi again,

You can declare a variable to store the answer previous to the load statement

LET vVersion = Input('Please specify version number', 'Warning');


Then create a variable with the path including the answer

SET vPath = C:\Directory\Whatever\Demand Model Version $(vVersion).xls;


Then load the file.

Hope that helps

Not applicable
Author

Hi Miguel A. Baeyens,

This code looks very intresting, i`ll try to execute this code today.

one Learning for the day. Thanks Geeked

-Sridhar

Not applicable
Author

Hi,

I have added the load script and variable as follows:

LET vDemandModelName = Input('Please demand model file name', 'Warning');
SET vDemandModelPath = C:\Directory\Whatever\Demand Model Version $(vDemandModelName).xls;

How do i add the vDemandModelPath to my load script below:

----------------

[DEMAND DATA]:
LOAD Month,
CAL_DAYS,
Start_Date,
Real_Data
FROM
[\\C:\Program Files\QlikView\Data\Demand Model Version 10.xls]
(biff, embedded labels, table is [Qlikview Output$]);

---------------------------------

i was thinking on the lines of

DEMAND DATA]:
LOAD Month,
CAL_DAYS,
Start_Date,
Real_Data
FROM
vDemandModelPath
(biff, embedded labels, table is [Qlikview Output$]);

and ideas?

Miguel_Angel_Baeyens

Hi,

Use dollar expansion

FROM [$(vDemandModelPath)](biff, embedded labels, table is [Qlikview Output$]);


Besides, is my custome to enclose in square brackets when spaces or blanks are likely.

Miguel_Angel_Baeyens

Many thanks Sridhar!