Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Command Line - Reload only 1st 1000

Hi Folks

We have an option when using the script debugger to reload the data but only with 1st 1000 rows of each table, this is not only useful but mandatory for us to check documents into source control as the powers that be for some reason don't want multiple versions of 3GB documents being stored in our source control database. I have to say I can't blame them which is why I have always followed this, but now that I have some 40 odd documents being checked into source control every two weeks it's a real pain in the backside running through this in the QV environment.

What I want to do is create a batch file that will do this for me, a simple series of command line actions that reloads every document with small amounts of data, but I can't find anywhere where this is documented.

Does anybody know how I would go about doing this?

Thanks,

Nigel.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Create a variable in the script, e.g. vRecs. You can use that variable in the script to check it's value

if $(vRecs) >0 then

          SET vFirstX = 'first $(vRecs)';

else

          set vFirstX =;

endif

$(vFirstX)

Table:

LOAD * FROM ...

SET vRecs = 0;

You can pass the variable as parameter with the /v flag:

qv.exe /r /vvRecs=1000 "C:\MyDoc\MyQvDoc.qvw"

You'll need to put $(vFirstX) above every load statement that loads data from external sources.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
sushil353
Master II
Master II

Hi,

In reference manual there are some commands given.

Hope that helps

6.1 Command Line Syntax

The QlikView command line invocation can be described by the following syntax

(for a description of the syntax notation used, see page 535 in Book III):

[ path ] Qv.exe [ { switch } documentfile ]

The path is the path to the file, either absolute, or relative to the current directory.

documentfile::= [ path ] documentfilename

documentfilename is the name of your document file.

switch is used to mark different options:

/r

Reload switch. The document will be opened and the script

reloaded. Thereafter the document will be saved, and QlikView will

close itself.

/rp

The same as above, but with a partial reload.

/l

Load new data. The document will be opened and the script

reloaded. The document will not be saved and QlikView will remain

open.

/lp

The same as above, but with a partial reload.

/v

If this switch is immediately followed by a variable name and an

assignment, the variable will obtain the assigned value before the

script execution starts.

/nodata

Opens the document without variables, table and field data. This

feature is also available for previously opened documents on the

Start Page, see page 43.

42

/NoSecurity

Overrides QlikView security measures against hostile macros and

scripts embedded in QlikView documents. No warning dialogs

prompting the user to accept potentially harmful code will be

shown. Use this switch with caution and only with well-known documents.

Example:

qv.exe /r /vMyvar=123 abc.qvw

Not applicable
Author

That's what I found in the manuals too...

And it doesn't mention any option to reload the data but only load the first 1000 (or N) rows of any table.

Gysbert_Wassenaar

Create a variable in the script, e.g. vRecs. You can use that variable in the script to check it's value

if $(vRecs) >0 then

          SET vFirstX = 'first $(vRecs)';

else

          set vFirstX =;

endif

$(vFirstX)

Table:

LOAD * FROM ...

SET vRecs = 0;

You can pass the variable as parameter with the /v flag:

qv.exe /r /vvRecs=1000 "C:\MyDoc\MyQvDoc.qvw"

You'll need to put $(vFirstX) above every load statement that loads data from external sources.


talk is cheap, supply exceeds demand
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

While not addressing your specific question, have you considered using the source control integration in qv?

http://community.qlik.com/docs/DOC-3424

Rob

Not applicable
Author

Thanks both

I think the answer from Gysbert can be a quick fix for me, but I'll certainly look into the source code integration and see what that can do to help me.

Much appreciated.