Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
MVP
MVP

Re: How to pass external parameter in a LOAD SCRIPT

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

5 Replies
MVP
MVP

Re: How to pass external parameter in a LOAD SCRIPT

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

Re: How to pass external parameter in a LOAD SCRIPT

Thank you,

You are very quick as usual.

Regards

Oronzo

MVP
MVP

Re: How to pass external parameter in a LOAD SCRIPT

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
Honored Contributor II

Re: How to pass external parameter in a LOAD SCRIPT

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

MVP
MVP

Re: How to pass external parameter in a LOAD SCRIPT

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

Community Browser