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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatically reload qvw

Hi all,

i have a txt file that contain the string "OK". 

I need to reload automatically my application when this file exists and  contains "OK".

How can i do?

Thanks a lot

Francesca

4 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Do you want to reload the qvw file from QMC or desktop client?

Where you want to reload the file from matters.

Let us know where you want to automate the reload from

Not applicable
Author

I want to reload qvw file from QMC.

Thanks

ajaykumar1
Creator III
Creator III

Hi,

You can reload it from QMC through Trigger option.

Documents--Source Documents--select your application--Triggers

Then choose whenever you want to reload the application automatically.

Second thing;

regarding the string contains OK...Please explain bit more whether its a field contains OK as string or some thing else.

Regards,

Ajay

Not applicable
Author

1. Create a QVW file and name it as say 'ReloadYesNo.QVW'.

2. Create a variable in Variable Overview and name it as vLastFileTimeStamp and enter 1 as it's definition.

3. Edit script and paste the below script. Assuming that your .txt file name is ReloadYesNo.txt and it contains OK (just OK) if reload should happen. Otherwise contains something else. Save and reload it.

IF Num('$(vLastFileTimeStamp)')< FileTime('ReloadYesNo.txt') then

LET vLastFileTimeStamp = FileTime('ReloadYesNo.txt');

OK:

LOAD @1 as F1 //Assuming the file contains just the word OK

FROM

ReloadYesNo.txt

(txt, codepage is 1252, explicit labels, delimiter is '\t', msq);

    IF Peek('F1')='OK' then

        TRACE Reload should be started;

    ELSE

        Load * From Tab1; //Just to make the reload fail

    ENDIF   

ELSE

Load * From Tab1; //Just to make the reload fail

ENDIF

4. In QMC, create a task (Say ReloadYesNo) for it and schedule it to reload for every 5 minutes (depending on your requirement).

5. Make the actual QVW task to be executed whenever ReloadYesNo task reload is successful.

I don't have access to QMC now to test this. Please do through testing.

Regards,

KKR