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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scheduling a QV script

Hey Members,

I have a QV script from which I daily import data. I want to schedule this task Please help me out with these simple things.

1. How to automatically update the file from which QV takes the data.

This is how it shows in script –

FROM


(txt, embedded labels);

I need it to update the date automatically so it can take the latest file.

2. After this need it to reload

3. Export the file into .csv format in some folder.

Do I need to make a BAT file to schedule it?? Or is this possible to schedule it from QV?? I do see an option of schedules in Document Properties.

I am very new in QV with very less background of coding. Your help will be much appreciated.

21 Replies
Anonymous
Not applicable
Author

Let Export= 'Q:\bns\derivProdData\spreadsheets\GEF\VG\Extract\SBI Positions Extract Test'& $(vdt)&'.xls';

// you need to give some table name

Table1:

LOAD TransId as [TransID],

     ReferenceAsset as [Reference Asset],

     DividendPassThrough as [% Dividend],                


FROM

Q:\bns\derivProdData\sybasePortfolio\GEF\positions\epsilon\GEF.ep.TRS.$(vdt).csv

(txt, embedded labels);

//$(Export)


//now store this table to a file

Store Table1 into Path/Filename.csv (txt);



Not applicable
Author

Thanks Kumar

Just a Quick question - I am getting following Script Security pop up message (attached).

Capture.PNG

Anyway to give system access permanently ?

Not applicable
Author

Also, I have used to some filters in the table via Current Selection.

How can I incorporate that in code ?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

This has nothing to do with the previous discussion (and you should create a new thread about this). The message box tells you that an EXECUTE statement is being used in your load script and that the checkbox Script Editor->Bottom pane:Settings->Open Database in Read-Write mode has been enabled. These are serious extensions of typical security settings.

Do you really need to execute command line programs outside QlikView and to write to your DB? Then select "Give System Access"

Peter

Not applicable
Author

Thanks Peter

Is there any way to store table only currently selected fields ?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

What do you mean by "Currently selected fields"?

A simple STORE statement will create a QVD from the internal table with the fields you have loaded.

An extended STORE only dumps the fields you name into the QVD.

Peter

Not applicable
Author

I mean if I have a data for 4 companies and I want to select only for 1 company.

I was searching few more threads. I saw someone suggesting to use -   

use variable like v1 with expression

=(SubField(GetcurrentSelections(),':',-1)) // for particular selection

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you don't want the data for the other three companies, then add a WHERE clause to your script and do not load their data.

Peter

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you want to store the data for companies you selected in the User Interface, you can't do this with a STORE statement, as a STORE writes an internal table to disk including all selected and unselected companies.

On the other hand, in the UI you can use the rightmousemenu and select export. That option offers you to export the data from the currently selected object/chart/table box/list box in a variety of file formats. Such an export will only write the data that is associated with the currently selected company.

Peter

Not applicable
Author

Can you provide me an example how to use where clause ?