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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Refer the QlickView script of one document inside other document

Hi All,

Can i refer the QlickView script of one existing document in other document ?

What i want here is:

I have written one script for my QV document, and i want the same script to use in other documents, so i dont want to write the same script again and again instead i want to use the existing script.

Is this possible to refer the script from other qv documents ?

I hope i am clear here.

Any suggestions will be appreaciated.

Thanks,

Mahasweta

5 Replies
biester
Specialist
Specialist

With include you cannot directly refer to another QVW, but you can use one text (script) file for more documents, e. g.:

$(Include=script.qvs)

Rgds,
Joachim

Not applicable
Author

It can be done in 2 steps.

1) Go to EditScript of the qvw and File-> export to scriptfile and save as a .qvs

2) In the second qvw where you want to use it write the include as Biester wrote

Regards

Sravan

Not applicable
Author

Hi All,

Thanks a ton Sravan.

Could you please send me some examples for the same if you have with you ?

Thanks,

Mahasweta

biester
Specialist
Specialist

Just for fun: another option would be:

In the "target" - files (where you want to use a script from another qvw) you have a module with:

1. a function retrieving the script from a given qvw
2. a sub where you modify the script of the document on open (you replace it with the script from the source qvw in my demo case)

It's a macro solution and certainly not applicable in several scenarios, but it works. Attached demo initially has no script; it requires a "source.qvw" with a script in the same directory. After opening it (the security/macro settings of course must allow it) you will see that it has the script of the qvw you defined as "source.qvw".

Rgds,
Joachim

Not applicable
Author

Hi , A simple example:

paths.txt

LET QVDdir = '..\..\QVD';

LET DATABASE = 'CRPDTA.';

...<add more default paths>

Within the QVW:





$(include=paths.txt);

--Arun

Now, this paths.txt (if in a different directory, prefix the path) can be commonly shared by all the QVWs wherever included.