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

How to pass external parameter in a LOAD SCRIPT

Hello to everybody,

I want to know if it is possible to pass external parameter inside

LOAD SCRIPT

I have this kind of script that load file from internet

LOAD var1,

    var2,

    .....

FROM [http://95....param1...param2...]

Is it possible to pass param1,param2..from a batch for example

call "C:\Program Files\QlikView\Qv.exe"  /vvPrintReports=1 /NoSecurity "C:\test.qvw"

Regards

Oronzo

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi Oronzo,

You can use them as variables, and pass them in the command line as you are suggesting in your batch line

"C:\Program Files\QlikView\qv.exe" /vvParameter1=100 /vvParameter2=200 /vvPrintReports=1 /NoSecurity "C:\test.qvw"

Then use the variables in your script

LOAD *

FROM [http://url?param1=$(vParameter1)&param2=$(vParameter2)];

These variables must exist in your document, although they may be empty (menu Settings, Variable Overview).

Another option is to create these variables in an external writable text script and load them using include:

$(include=ExternalVariables.txt);

Where the ExternalVariables.txt file looks like

SET vParameter1 = 100;

SET vParameter2 = 200;

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

5 Replies
Miguel_Angel_Baeyens

Hi Oronzo,

You can use them as variables, and pass them in the command line as you are suggesting in your batch line

"C:\Program Files\QlikView\qv.exe" /vvParameter1=100 /vvParameter2=200 /vvPrintReports=1 /NoSecurity "C:\test.qvw"

Then use the variables in your script

LOAD *

FROM [http://url?param1=$(vParameter1)&param2=$(vParameter2)];

These variables must exist in your document, although they may be empty (menu Settings, Variable Overview).

Another option is to create these variables in an external writable text script and load them using include:

$(include=ExternalVariables.txt);

Where the ExternalVariables.txt file looks like

SET vParameter1 = 100;

SET vParameter2 = 200;

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Thank you,

You are very quick as usual.

Regards

Oronzo

Miguel_Angel_Baeyens

Hi Oronzo,

Glad to help. Check the second option, that I have just edited.

Regards.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

IAMDV
Luminary Alumni
Luminary Alumni

Miguel – Thanks for the solution. I have few questions on this... hope you can answer.

  1. I am assuming we can run this from command prompt on Server, Is this right?
  2. Practically in which scenario do we need this solution?

Many thanks in advance.

I wanted to learn something new today

Cheers - DV

Miguel_Angel_Baeyens

Hi D V,

I'm assuming we are not have QlikView Server available, otherwise I had created the reload task in it, or that was my idea, since it's always better to let QlikView manage the reloads. The qv.exe is the Desktop executable file as you already know, and you can trigger this with the Windows Scheduler with a line similar to what I posted. So if you have Server and you want to do this way, you will need to install Desktop in your Server as well. As you know, you need an EDX trigger (with Publisher license) to reload not using the Management Console.

I do see a lot of sense using includes with variables, for example, when the document is being developed by more than one person, or when I have some permissions in the folder but I want people change some values.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica